示例#1
0
文件: client.go 项目: marleyg/tmsp
func (cli *TMSPClient) SetOptionSync(key string, value string) (log string, err error) {
	reqres := cli.queueRequest(types.RequestSetOption(key, value))
	cli.FlushSync()
	if cli.err != nil {
		return "", cli.err
	}
	return reqres.Response.Log, nil
}
示例#2
0
func (app *localAppConn) SetOptionAsync(key string, value string) *tmspcli.ReqRes {
	app.mtx.Lock()
	log := app.Application.SetOption(key, value)
	app.mtx.Unlock()
	app.Callback(
		tmsp.RequestSetOption(key, value),
		tmsp.ResponseSetOption(log),
	)
	return nil // TODO maybe create a ReqRes
}
示例#3
0
文件: tmsp-cli.go 项目: marleyg/tmsp
// Set an option on the application
func cmdSetOption(c *cli.Context) {
	args := c.Args()
	if len(args) != 2 {
		fmt.Println("set_option takes 2 arguments (key, value)")
		return
	}
	res, err := makeRequest(conn, types.RequestSetOption(args[0], args[1]))
	if err != nil {
		fmt.Println(err.Error())
		return
	}
	printResponse(res, Fmt("%s=%s", args[0], args[1]))
}
示例#4
0
文件: client.go 项目: marleyg/tmsp
func (cli *TMSPClient) SetOptionAsync(key string, value string) *ReqRes {
	return cli.queueRequest(types.RequestSetOption(key, value))
}