MCPcopy Index your code
hub / github.com/riverqueue/river / Work

Method Work

example_job_cancel_from_client_test.go:29–37  ·  view source on GitHub ↗
(ctx context.Context, job *river.Job[CancellingArgs])

Source from the content-addressed store, hash-verified

27}
28
29func (w *SleepingWorker) Work(ctx context.Context, job *river.Job[CancellingArgs]) error {
30 w.jobChan <- job.ID
31 select {
32 case <-ctx.Done():
33 case <-time.After(5 * time.Second):
34 return errors.New("sleeping worker timed out")
35 }
36 return ctx.Err()
37}
38
39// Example_jobCancelFromClient demonstrates how to permanently cancel a job from
40// any Client using JobCancel.

Callers

nothing calls this directly

Calls 3

DoneMethod · 0.80
AfterMethod · 0.80
ErrMethod · 0.45

Tested by

no test coverage detected