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

Method Work

example_subscription_test.go:30–38  ·  view source on GitHub ↗
(ctx context.Context, job *river.Job[SubscriptionArgs])

Source from the content-addressed store, hash-verified

28}
29
30func (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.

Callers

nothing calls this directly

Calls 1

JobCancelFunction · 0.92

Tested by

no test coverage detected