Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NonBlockingFifoQueue ¶
It is a FIFO queue with the functionality that dropping the front if the queue size reaches to the maxSize
func NewNonBlockingFifoQueue ¶
func NewNonBlockingFifoQueue(size int) *NonBlockingFifoQueue
func (*NonBlockingFifoQueue) Dequeue ¶
func (u *NonBlockingFifoQueue) Dequeue() (interface{}, bool)
func (*NonBlockingFifoQueue) Enqueue ¶
func (u *NonBlockingFifoQueue) Enqueue(value interface{})
type Publisher ¶
type Publisher struct { // After close is set to true, subsequent calling Publish will be a no-op sync.RWMutex // contains filtered or unexported fields }
Publisher is go-routing safe
func NewPublisher ¶
func NewPublisher(queue Queue, concurrency int64, drainTimeout time.Duration, fn func(req interface{})) (*Publisher, error)
Create a publisher with parameters: queue: specify the underlining queue concurrency: specify the worker thread to consume the queue drainTimeout: time to wait for draining the on-hold requests when calling Close() fn: specify the publishing method to call
Click to show internal directories.
Click to hide internal directories.