Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRequestQueue ¶
func NewRequestQueue(queueLen int) *requestQueueImpl
Types ¶
type InitializedQueue ¶
type InitializedQueue struct { NewQueue chan *protos.SyncRPCRequest OldQueue chan *protos.SyncRPCRequest }
InitializedQueue contains an initialized NewQueue, and an OldQueue to cleanup if any
type RequestQueue ¶
type RequestQueue interface { InitializeQueue(gwId string) InitializedQueue CleanupQueue(gwId string) chan *protos.SyncRPCRequest Enqueue(req *protos.SyncRPCRequest) error }
type ResponseTable ¶
type ResponseTable interface { InitializeResponse() (chan *protos.GatewayResponse, uint32) SendResponse(*protos.SyncRPCResponse) error }
type ResponseTableImpl ¶
type ResponseTableImpl struct {
// contains filtered or unexported fields
}
func NewResponseTable ¶
func NewResponseTable(timeout time.Duration) *ResponseTableImpl
func (*ResponseTableImpl) InitializeResponse ¶
func (table *ResponseTableImpl) InitializeResponse() (chan *protos.GatewayResponse, uint32)
InitializeResponse creates a request ID to bind to the GatewayResponse channel, so when SyncRPCResponse comes back, it can be written to the corresponding GatewayResponse channel identified by the request id.
func (*ResponseTableImpl) SendResponse ¶
func (table *ResponseTableImpl) SendResponse(resp *protos.SyncRPCResponse) error
SendResponse sends the response to the corresponding response channel
Click to show internal directories.
Click to hide internal directories.