(ctx context.Context, job *river.Job[SubscriptionArgs])
| 28 | } |
| 29 | |
| 30 | func (w *SubscriptionWorker) Work(ctx context.Context, job *river.Job[SubscriptionArgs]) error { |
| 31 | switch { |
| 32 | case job.Args.Cancel: |
| 33 | return river.JobCancel(errors.New("cancelling job")) |
| 34 | case job.Args.Fail: |
| 35 | return errors.New("failing job") |
| 36 | } |
| 37 | return nil |
| 38 | } |
| 39 | |
| 40 | // Example_subscription demonstrates the use of client subscriptions to receive |
| 41 | // events containing information about worked jobs. |
nothing calls this directly
no test coverage detected