Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Queue ¶
type Queue interface {
// Put puts item into the queue and keeps blocking if the queue is full.
// It will return immediately and do nothing if the item is nil.
Put(item interface{})
// PutTimeout puts item into the queue and waits for timeout if the queue is full.
// If timeout <= 0, it will return false immediately when queue is full.
// It will return immediately and do nothing if the item is nil.
PutTimeout(item interface{}, timeout time.Duration) bool
// Poll gets an item from the queue and keeps blocking if the queue is empty.
Poll() interface{}
// PollTimeout gets an item from the queue and waits for timeout if the queue is empty.
// If timeout <= 0, it will return (nil, bool) immediately when queue is empty.
PollTimeout(timeout time.Duration) (interface{}, bool)
// Len returns the current size of the queue.
Len() int
}
Queue blocking queue. The items putted into queue mustn't be nil.
Click to show internal directories.
Click to hide internal directories.