Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NSQStorage ¶
func NewNSQStorage ¶
func NewNSQStorage(producer *nsq.Producer, consumer *nsq.Consumer, topic string) (*NSQStorage, error)
func (*NSQStorage) AddRequest ¶
func (nsq *NSQStorage) AddRequest(r []byte) error
AddRequest adds a serialized request to the queue
func (*NSQStorage) GetRequest ¶
func (nsq *NSQStorage) GetRequest() ([]byte, error)
GetRequest pops the next request from the queue or returns error if the queue is empty
func (*NSQStorage) QueueSize ¶
func (nsq *NSQStorage) QueueSize() (int, error)
QueueSize returns with the size of the queue
type Queue ¶
type Queue struct { // Threads defines the number of consumer threads Threads int // contains filtered or unexported fields }
Queue is a request queue which uses a Collector to consume requests in multiple threads
func New ¶
New creates a new queue with a Storage specified in argument A standard InMemoryQueueStorage is used if Storage argument is nil.
func (*Queue) AddRequest ¶
AddRequest adds a new Request to the queue
Click to show internal directories.
Click to hide internal directories.