Documentation
¶
Overview ¶
Package executor runs one attempt of a job and maps the result to a completion.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoWorker = job.ErrNoWorker
Functions ¶
This section is empty.
Types ¶
type Attempt ¶
func AttemptFromContext ¶
func (*Attempt) CompletedInTx ¶
func (*Attempt) MarkCompletedInTx ¶
func (a *Attempt) MarkCompletedInTx()
type Config ¶
type Config struct {
Lookup func(kind string) (Handler, bool)
DefaultTimeout time.Duration
DefaultRetry RetryFunc
HandleError func(ctx context.Context, row *job.Row, err error) *job.Override
HandlePanic func(ctx context.Context, row *job.Row, value any, trace string) *job.Override
Clock clock.Clock
Logger *slog.Logger
Observe func(row *job.Row, outcome string, d time.Duration)
}
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor runs a job with a timeout and panic recovery and maps the result to a completion.
Click to show internal directories.
Click to hide internal directories.