Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { service.Service types.Application // TODO: remove as each method now returns an error Error() error // TODO: remove as this is not implemented Flush(context.Context) error Echo(context.Context, string) (*types.ResponseEcho, error) // FIXME: All other operations are run synchronously and rely // on the caller to dictate concurrency (i.e. run a go routine), // with the exception of `CheckTxAsync` which we maintain // for the v0 mempool. We should explore refactoring the // mempool to remove this vestige behavior. SetResponseCallback(Callback) CheckTxAsync(context.Context, *types.RequestCheckTx) (*ReqRes, error) }
Client defines the interface for an ABCI client.
NOTE these are client errors, eg. ABCI socket connectivity issues. Application-related errors are reflected in response via ABCI error codes and (potentially) error response.
func NewClient ¶
NewClient returns a new ABCI client of the specified transport type. It returns an error if the transport is not "socket" or "grpc"
func NewGRPCClient ¶
func NewLocalClient ¶
func NewLocalClient(mtx *cmtsync.Mutex, app types.Application) Client
NewLocalClient creates a local client, which wraps the application interface that Tendermint as the client will call to the application as the server. The only difference, is that the local client has a global mutex which enforces serialization of all the ABCI calls from Tendermint to the Application.
func NewSocketClient ¶
NewSocketClient creates a new socket client, which connects to a given address. If mustConnect is true, the client will return an error upon start if it fails to connect else it will continue to retry.
type ReqRes ¶
type ReqRes struct { *types.Request *sync.WaitGroup *types.Response // Not set atomically, so be sure to use WaitGroup. // contains filtered or unexported fields }
func (*ReqRes) GetCallback ¶
GetCallback returns the configured callback of the ReqRes object which may be nil. Note, it is not safe to concurrently call this in cases where it is marked done and SetCallback is called before calling GetCallback as that will invoke the callback twice and create a potential race condition.
func (*ReqRes) InvokeCallback ¶
func (r *ReqRes) InvokeCallback()
InvokeCallback invokes a thread-safe execution of the configured callback if non-nil.
func (*ReqRes) SetCallback ¶
Sets sets the callback. If reqRes is already done, it will call the cb immediately. Note, reqRes.cb should not change if reqRes.done and only one callback is supported.