Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConcurrentQueue ¶
type ConcurrentQueue struct {
// contains filtered or unexported fields
}
ConcurrentQueue - A queue which is go-routine safe
func (*ConcurrentQueue) Dequeue ¶
func (mq *ConcurrentQueue) Dequeue() (interface{}, bool)
func (*ConcurrentQueue) Enqueue ¶
func (mq *ConcurrentQueue) Enqueue(item interface{})
func (*ConcurrentQueue) Len ¶
func (mq *ConcurrentQueue) Len() int
func (*ConcurrentQueue) WaitForItem ¶
func (mq *ConcurrentQueue) WaitForItem() interface{}
type Queue ¶
type Queue interface { // Enqueue an element to the queue Enqueue(item interface{}) // Dequeue an element from the queue Dequeue() (interface{}, bool) // Len returns length of the underlying queue Len() int // WaitForItem waut until an item in the underlying queue is ready // Once an item is available. Dequeue this item and return it WaitForItem() interface{} }
Queue - An interface to queues
func NewConcurrentQueue ¶
func NewConcurrentQueue() Queue
Click to show internal directories.
Click to hide internal directories.