Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConcurrentQueue ¶
type ConcurrentQueue struct {
// contains filtered or unexported fields
}
ConcurrentQueue is a pool of goroutines processing a stream of jobs. Job callbacks are called in the order they are added.
func NewConcurrentQueue ¶
func NewConcurrentQueue(maxConcurrency int, initialElems ...func()) *ConcurrentQueue
NewConcurrentQueue constructs a new stream concurrency manager. initialElems contains the initial set of queued entries. if maxConcurrency <= 0, spawns infinite goroutines.
func (*ConcurrentQueue) Enqueue ¶
func (s *ConcurrentQueue) Enqueue(jobs ...func())
Enqueue enqueues a job callback to the stream. Returns the current number of queued jobs. Note: may return 0 if the job was started immediately & the queue is empty.
Click to show internal directories.
Click to hide internal directories.