WorkFunc wraps a function to implement the Worker interface. A job args struct implementing JobArgs will still be required to specify a Kind. For example: river.AddWorker(workers, river.WorkFunc(func(ctx context.Context, job *river.Job[WorkFuncArgs]) error { fmt.Printf("Message: %s", job.Args.M
(f func(context.Context, *Job[T]) error)
| 219 | // return nil |
| 220 | // })) |
| 221 | func WorkFunc[T JobArgs](f func(context.Context, *Job[T]) error) Worker[T] { |
| 222 | return &workFunc[T]{f: f, kind: (*new(T)).Kind()} |
| 223 | } |
searching dependent graphs…