Example #1
0
func (cli *grpcClient) InfoAsync() *ReqRes {
	req := types.ToRequestInfo()
	res, err := cli.client.Info(context.Background(), req.GetInfo(), grpc.FailFast(true))
	if err != nil {
		cli.StopForError(err)
	}
	return cli.finishAsyncCall(req, &types.Response{&types.Response_Info{res}})
}
Example #2
0
func (cli *socketClient) InfoSync() (res types.Result) {
	reqres := cli.queueRequest(types.ToRequestInfo())
	cli.FlushSync()
	if err := cli.Error(); err != nil {
		return types.ErrInternalError.SetLog(err.Error())
	}
	resp := reqres.Response.GetInfo()
	return types.Result{Code: OK, Data: []byte(resp.Info), Log: LOG}
}
Example #3
0
func (app *localClient) InfoAsync() *ReqRes {
	app.mtx.Lock()
	info := app.Application.Info()
	app.mtx.Unlock()
	return app.callback(
		types.ToRequestInfo(),
		types.ToResponseInfo(info),
	)
}
Example #4
0
func (cli *socketClient) InfoAsync() *ReqRes {
	return cli.queueRequest(types.ToRequestInfo())
}