Documentation ¶
Index ¶
- func Pack(respErr error, msg *proto.Message) ([]byte, error)
- func Unpack([]byte) (*proto.Message, error)
- type ClusteredClient
- func (c *ClusteredClient) Handled(ctx context.Context, requestId string, resp []byte) error
- func (c *ClusteredClient) Invalidate(ctx context.Context, requestId string) error
- func (c *ClusteredClient) Receive(ctx context.Context, requestId string, respOut *[]byte) (Status, error)
- func (c *ClusteredClient) ReceiveAndWait(ctx context.Context, requestId string, respOut *[]byte) (Status, error)
- func (c *ClusteredClient) Wait(ctx context.Context, requestId string, respOut *[]byte) error
- type Interface
- type PassThroughClient
- func (c *PassThroughClient) Handled(ctx context.Context, requestId string, resp []byte) error
- func (c *PassThroughClient) Invalidate(ctx context.Context, requestId string) error
- func (c *PassThroughClient) Receive(ctx context.Context, requestId string, respOut *[]byte) (Status, error)
- func (c *PassThroughClient) ReceiveAndWait(ctx context.Context, requestId string, respOut *[]byte) (Status, error)
- func (c *PassThroughClient) Wait(ctx context.Context, requestId string, respOut *[]byte) error
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClusteredClient ¶
type ClusteredClient struct { // the maximum amount of time to wait for a handled request. Note that // by leverage a context cancel or timeout, this value can be decreased // on a per-call basis. MaxWaitTimeout time.Duration // the time to wait between polling for a handled request PollInterval time.Duration // the redis client to use RedisClient *redis.ClusterClient // the maximum amount of time to hold the Request ID in memory. In other words, // the time window in which to deduplicate requests. Ttl time.Duration // the maximum amount of time to wait Handled() to be called // before returning a time out error WaitFor time.Duration }
func (*ClusteredClient) Invalidate ¶
func (c *ClusteredClient) Invalidate(ctx context.Context, requestId string) error
func (*ClusteredClient) ReceiveAndWait ¶
type Interface ¶
type Interface interface { Handled(ctx context.Context, requestId string, resp []byte) error Invalidate(ctx context.Context, requestId string) error Receive(ctx context.Context, requestId string, respOut *[]byte) (Status, error) ReceiveAndWait(ctx context.Context, requestId string, respOut *[]byte) (Status, error) Wait(ctx context.Context, requestId string, respOut *[]byte) error }
type PassThroughClient ¶
type PassThroughClient struct{}
PassThroughClient is a client that behaves like there is no cache and returns sensible values for all operations so the caller can proceed normally; however, it will not handle idempotent use-cases correctly.
func (*PassThroughClient) Invalidate ¶
func (c *PassThroughClient) Invalidate(ctx context.Context, requestId string) error
func (*PassThroughClient) ReceiveAndWait ¶
Click to show internal directories.
Click to hide internal directories.