Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SingleQueue ¶
type SingleQueue struct {
// contains filtered or unexported fields
}
SingleQueue is a concurrency queue that supports only one function. Each process waits its turn to execute. A number n of processes may run at concurrently. The queue waits for all processes to finish.
func NewSingleQueue ¶
func NewSingleQueue(n int) *SingleQueue
NewSingleQueue creates a new concurrency queue of type SingleQueue. Parameter n is the number of processes allowed to be run concurrently. If n <= 0, then n=runtime.NumCPU().
func (*SingleQueue) Allowed ¶
func (q *SingleQueue) Allowed() int
func (*SingleQueue) Run ¶
func (q *SingleQueue) Run(f func(int), i int)
Run queries the SingleQueue to run function f with id i. It may or may not run immediately.
Click to show internal directories.
Click to hide internal directories.