MCPcopy Create free account
hub / github.com/riverqueue/river / WorkBegin

Method WorkBegin

rivertype/river_type.go:369–369  ·  view source on GitHub ↗

WorkBegin is invoked after a job has been locked and assigned to a particular executor for work and just before the job is actually worked. Returning an error from any HookWorkBegin hook will abort the job early such that it has an error set and doesn't work, with a retry scheduled according to its

(ctx context.Context, job *JobRow)

Source from the content-addressed store, hash-verified

367 // discarded after the function returns. If persistent context needs to be
368 // set, middleware should be used instead.
369 WorkBegin(ctx context.Context, job *JobRow) error
370}
371
372// HookWorkEnd is an interface to a hook that runs after a job has been worked.

Callers 1

executeMethod · 0.65

Implementers 6

JobWithHooksBothInsertAndWorkBeginHookexample_job_args_hooks_test.go
JobWithHooksWorkBeginHookexample_job_args_hooks_test.go
BothInsertAndWorkBeginHookexample_global_hooks_test.go
WorkBeginHookexample_global_hooks_test.go
testHookInsertAndWorkBegininternal/hooklookup/hook_lookup_test.g
testHookWorkBegininternal/hooklookup/hook_lookup_test.g

Calls

no outgoing calls

Tested by

no test coverage detected