Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Publisher ¶
type Publisher struct {
// contains filtered or unexported fields
}
Publisher publishes tasks carrying the provided function to the queueManager, Which will pass the task on to a worker which runs the task using the provided parameters.
type Supervisor ¶
type Supervisor struct {
// contains filtered or unexported fields
}
Supervisor starts, registers and shuts down workers.
func NewSupervisor ¶
func NewSupervisor(numberOfWorkers int) *Supervisor
NewSupervisor creates a new Supervisor instance and amount of workers equal to numberOfWorkers.
func (*Supervisor) Register ¶
Register registers a new function and returns an instance of Publisher. This Publisher instance publishes new tasks that'll be run within the provided function.
func (*Supervisor) Shutdown ¶
func (sv *Supervisor) Shutdown()
Shutdown gracefully shuts down all workers. Run Shutdown in a separate routine in case you do not want to wait for Shutdown to finish. No new tasks should be published after Shutdown has been called.