Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Queue ¶
type Queue interface { // Append adds the data to the Queue at priority level PriorityNormal. Append(data interface{}) // AppendPriority adds the data to the Queue with respect to priority. AppendPriority(data interface{}, priority QueuePriority) // Signal returns the Queue signal channel. Signal() <-chan struct{} // Next returns the data at the front of the Queue. Next() (interface{}, bool) // Process will execute the callback parameter for each element on the Queue. Process(callback func(interface{})) // Empty returns true if the Queue is empty. Empty() bool // Len returns the current length of the Queue. Len() int }
Queue implements a FIFO data structure that can support a few priorities.
type QueuePriority ¶ added in v0.3.0
type QueuePriority int
const ( PriorityLow QueuePriority = 0 PriorityNormal QueuePriority = 1 PriorityHigh QueuePriority = 2 PriorityCritical QueuePriority = 3 )
The priority levels for the priority Queue.
Click to show internal directories.
Click to hide internal directories.