AddWorker registers a Worker on the provided Workers bundle. Each Worker must be registered so that the Client knows it should handle a specific kind of job (as returned by its `Kind()` method). Use by explicitly specifying a JobArgs type and then passing an instance of a worker for the same type:
(workers *Workers, worker Worker[T])
| 106 | // an application with invalid hardcoded runtime configuration. If you want to |
| 107 | // avoid panics, use AddWorkerSafely instead. |
| 108 | func AddWorker[T JobArgs](workers *Workers, worker Worker[T]) { |
| 109 | if err := AddWorkerSafely(workers, worker); err != nil { |
| 110 | panic(err) |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | // AddWorkerArgs is the same as AddWorker except that it lets args be passed |
| 115 | // explicitly rather than being instantiated implicitly. We don't know of any |
searching dependent graphs…