Documentation
¶
Index ¶
- type Worker
- type Workers
- func (r *Workers) Add(w Worker) *Workers
- func (r *Workers) AddFunc(name string, run func(ctx context.Context) error) *Workers
- func (r *Workers) AllHealthy() bool
- func (r *Workers) AnyCrashed() bool
- func (r *Workers) Drain(timeout time.Duration)
- func (r *Workers) SetDrainBudget(name string, budget time.Duration) *Workers
- func (r *Workers) Start(ctx context.Context)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Workers ¶
type Workers struct {
// contains filtered or unexported fields
}
func NewWorkers ¶
func (*Workers) AllHealthy ¶
func (*Workers) AnyCrashed ¶
func (*Workers) SetDrainBudget ¶ added in v0.30.0
SetDrainBudget gives one worker its own drain window. Call before Start. Drain uses max(timeout, budget) for that worker, so a global window can never truncate a worker that declared it needs longer.
Click to show internal directories.
Click to hide internal directories.