Documentation
¶
Index ¶
- type Queue
- func (c *Queue) Dequeue()
- func (c *Queue) Empty() bool
- func (c *Queue) Enqueue(v interface{})
- func (c *Queue) Front() interface{}
- func (c *Queue) GetElements() (elements []interface{})
- func (c *Queue) Pop() interface{}
- func (c *Queue) Remove(Predicate func(v interface{}) bool) interface{}
- func (c *Queue) Size() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue is a wrapper around container/list. Queue is atomic
func (*Queue) Dequeue ¶
func (c *Queue) Dequeue()
Dequeue atomically removes the back element of l. If the queue is empty, Dequeue waits for a new element to be enqueued and then removes it
func (*Queue) Enqueue ¶
func (c *Queue) Enqueue(v interface{})
Enqueue atomically inserts a new element e with value v to the back of queue c
func (*Queue) Front ¶
func (c *Queue) Front() interface{}
Front atomically fetch the front element of c
func (*Queue) GetElements ¶
func (c *Queue) GetElements() (elements []interface{})
GetElements atomically returns all the elements of c in a slice
func (*Queue) Pop ¶
func (c *Queue) Pop() interface{}
Pop atomically removes the back element of l and returns it. If the queue is empty, Pop waits for a new element to be enqueued, removes it and returns the value
Click to show internal directories.
Click to hide internal directories.