Versions in this module Expand all Collapse all v1 v1.0.0 Jun 17, 2020 Changes in this version + type Communicator interface + Add func(ctx context.Context, worker, task interface{}) error + List func(ctx context.Context, worker interface{}) ([]interface{}, error) + Remove func(ctx context.Context, worker, task interface{}) error + type Logger interface + Printf func(format string, v ...interface{}) + type Orchestrator struct + func New(c Communicator, opts ...OrchestratorOption) *Orchestrator + func (o *Orchestrator) AddTask(task interface{}, opts ...TaskOption) + func (o *Orchestrator) AddWorker(worker interface{}) + func (o *Orchestrator) LastActual() []WorkerState + func (o *Orchestrator) ListExpectedTasks() []Task + func (o *Orchestrator) NextTerm(ctx context.Context) + func (o *Orchestrator) Rebalance(toAdd map[interface{}]int, toRemove, actual map[interface{}][]interface{}) (map[interface{}]int, map[interface{}][]interface{}) + func (o *Orchestrator) RemoveTask(task interface{}) + func (o *Orchestrator) RemoveWorker(worker interface{}) + func (o *Orchestrator) UpdateTasks(tasks []Task) + func (o *Orchestrator) UpdateWorkers(workers []interface{}) + type OrchestratorOption func(*Orchestrator) + func WithCommunicatorTimeout(t time.Duration) OrchestratorOption + func WithLogger(l Logger) OrchestratorOption + func WithStats(f func(TermStats)) OrchestratorOption + type Task struct + Instances int + Name interface{} + type TaskOption func(*Task) + func WithTaskInstances(i int) TaskOption + type TermStats struct + WorkerCount int + type WorkerState struct + Name interface{} + Tasks []interface{}