Documentation
¶
Index ¶
Constants ¶
View Source
const ContextKeyMetadataUpdates contextKey = "river_metadata_updates"
ContextKeyMetadataUpdates is the context key for the metadata updates map stored in the context. It's exposed from this internal package solely so that it can be used in tests for JobCompleteTx.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClientRetryPolicy ¶
type ErrorHandler ¶
type ErrorHandler interface {
// HandleError is invoked in case of an error occurring in a job.
//
// Context is descended from the one used to start the River client that
// worked the job.
HandleError(ctx context.Context, job *rivertype.JobRow, err error) *ErrorHandlerResult
// HandlePanic is invoked in case of a panic occurring in a job.
//
// Context is descended from the one used to start the River client that
// worked the job.
HandlePanic(ctx context.Context, job *rivertype.JobRow, panicVal any, trace string) *ErrorHandlerResult
}
ErrorHandler provides an interface that will be invoked in case of an error or panic occurring in the job. This is often useful for logging and exception tracking, but can also be used to customize retry behavior.
type ErrorHandlerResult ¶
type ErrorHandlerResult struct {
// SetCancelled can be set to true to fail the job immediately and
// permanently. By default it'll continue to follow the configured retry
// schedule.
SetCancelled bool
}
type JobExecutor ¶
type JobExecutor struct {
baseservice.BaseService
CancelFunc context.CancelCauseFunc
ClientJobTimeout time.Duration
Completer jobcompleter.JobCompleter
ClientRetryPolicy ClientRetryPolicy
DefaultClientRetryPolicy ClientRetryPolicy
ErrorHandler ErrorHandler
InformProducerDoneFunc func(jobRow *rivertype.JobRow)
JobRow *rivertype.JobRow
GlobalMiddleware []rivertype.WorkerMiddleware
SchedulerInterval time.Duration
WorkUnit workunit.WorkUnit
// contains filtered or unexported fields
}
func (*JobExecutor) Cancel ¶
func (e *JobExecutor) Cancel()
func (*JobExecutor) Execute ¶
func (e *JobExecutor) Execute(ctx context.Context)
Click to show internal directories.
Click to hide internal directories.