Documentation ¶ Index ¶ type Job type Option func WithConcurrency(concurrency int) Option func WithInterval(interval time.Duration) Option type Worker func New(job Job, opts ...Option) *Worker func (w *Worker) Run(ctx context.Context) func (w *Worker) Shutdown() Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Job ¶ type Job interface { Do(ctx context.Context) } type Option ¶ type Option func(w *Worker) func WithConcurrency ¶ func WithConcurrency(concurrency int) Option func WithInterval ¶ func WithInterval(interval time.Duration) Option type Worker ¶ type Worker struct { // contains filtered or unexported fields } func New ¶ func New(job Job, opts ...Option) *Worker func (*Worker) Run ¶ func (w *Worker) Run(ctx context.Context) func (*Worker) Shutdown ¶ func (w *Worker) Shutdown() Source Files ¶ View all Source files options.go worker.go Click to show internal directories. Click to hide internal directories.