Documentation ¶
Overview ¶
Package hivemind implements a simple worker pool, basically a `sync.Waitgroup` with fancy terminal output. Jobs added to a hive mind are executed by workers until `Wait` is called.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Hivemind ¶
type Hivemind struct {
// contains filtered or unexported fields
}
A Hivemind wraps a worker pool
func New ¶
New creates a new Hivemind. The `workers` variable sets the number of workers to instantiate. If <= 0, `workers` defaults to the number of CPU's present.
func (*Hivemind) AddJob ¶
AddJob adds a job to the queue. If they weren't active already, spin up the workers.
Click to show internal directories.
Click to hide internal directories.