memstore

package
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2020 License: BSD-3-Clause Imports: 7 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL