Discover Packages
github.com/bucket-sailor/queue
package
module
Version:
v0.4.0
Opens a new window with list of versions in this module.
Published: Feb 6, 2024
License: BSD-3-Clause
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 2
Opens a new window with list of known importers.
README
README
¶
Queue
A thread safe work queue for Go.
Based originally on the implementation found internally in the Go compiler.
Expand ▾
Collapse ▴
Documentation
¶
Queue manages a set of work items to be executed in parallel. The number of
active work items is limited, and excess items are queued sequentially.
NewQueue returns a Queue that executes up to maxActive items in parallel.
maxActive must be positive.
Add adds f as a work item in the queue.
Add returns immediately, but the queue will be marked as non-idle until after
f (and any subsequently-added work) has completed.
Wait blocks until the queue becomes idle. The queue is considered idle if no
work items are running and no work items are waiting to run. Returns the first
error encountered by a worker, or nil if all work completed
Source Files
¶
Click to show internal directories.
Click to hide internal directories.