Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Queue ¶ added in v1.0.0
Queue is a queue that implements bucket based depth-first or breadth-first queue.
The breadth-first queues allow defining scores on whose basis the bucket is distributed. Lower scores are picked up first, and higher scores which have a greater chance of being just random noise are picked up later in depth first.
Depth-first queue uses a simple stack for LIFO operations and distributes items as they come in.
func (*Queue) Done ¶ added in v1.9.0
func (q *Queue) Done()
Done marks an item received from Pop as finished, after it has pushed everything it found. Pop closes once the queue is empty and every received item is done.
func (*Queue) Pop ¶ added in v1.0.0
func (q *Queue) Pop() chan interface{}
Pop pops elements from the queue (backward-compatible, no context).
func (*Queue) PopWithContext ¶ added in v1.7.0
PopWithContext pops elements from the queue, respecting context cancellation. If ctx is nil, context.Background() is used. Call Done for every received item.