Documentation ¶
Overview ¶
Package task implements generic controller tasks running in goroutines.
Index ¶
- type EqualSpec
- type EqualityFunc
- type ID
- type Runner
- func (runner *Runner[T, S]) Reconcile(ctx context.Context, logger *zap.Logger, shouldRun map[ID]S, in T)
- func (runner *Runner[T, S]) StartTask(ctx context.Context, logger *zap.Logger, id string, spec S, task T)
- func (runner *Runner[T, S]) Stop()
- func (runner *Runner[T, S]) StopTask(logger *zap.Logger, id string)
- type Spec
- type Task
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EqualityFunc ¶
EqualityFunc is used to compare two task specs.
type Runner ¶
Runner manages running tasks.
func NewEqualRunner ¶
NewEqualRunner creates a new task runner from spec with Equal method.
func NewRunner ¶
func NewRunner[T any, S Spec[T]](equalityFunc EqualityFunc[S]) *Runner[T, S]
NewRunner creates a new task runner.
func (*Runner[T, S]) Reconcile ¶
func (runner *Runner[T, S]) Reconcile(ctx context.Context, logger *zap.Logger, shouldRun map[ID]S, in T)
Reconcile running tasks.
Click to show internal directories.
Click to hide internal directories.