Method
Work
(ctx context.Context, job *river.Job[CancellingArgs])
Source from the content-addressed store, hash-verified
| 27 | } |
| 28 | |
| 29 | func (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
Tested by
no test coverage detected