Example #1
0
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
}
Example #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
}
Example #3
0
// 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]))
}
Example #4
0
func (cli *TMSPClient) SetOptionAsync(key string, value string) *ReqRes {
	return cli.queueRequest(types.RequestSetOption(key, value))
}