Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Queue ¶
type Queue interface { // Take pops an item off the head of the queue, waits indefinitely Take() interface{} // TakeChan pops an item off the head of the queue, waits time.Duration. If duration <0 waits indefinitely // Return chan interface for item in quey, and error chan for timeout TakeChan(time.Duration) (<-chan interface{}, <-chan error) // Poll removes item off the head of the queue, returns immediately. Returns item, bool is true if item was in // deque, false otherwise Poll() (interface{}, bool) // Put puts item in deque, waits indefinitely Put(item interface{}) // Offer puts the item in queue. If successful return true, if queue is full return false Offer(item interface{}) bool //Returns the current number of items in the queue Size() int32 //Returns the current number of items the queue can hold Capacity() int32 }
Queue is a bounded blocking queue
func NewChannelQueue ¶
NewChannelQueue creates a queue with a given capacity. If capacity <=0, error is returned
Click to show internal directories.
Click to hide internal directories.