MCPcopy
hub / github.com/riverqueue/river / AddWorkerArgs

Function AddWorkerArgs

worker.go:119–123  ·  view source on GitHub ↗

AddWorkerArgs is the same as AddWorker except that it lets args be passed explicitly rather than being instantiated implicitly. We don't know of any use for this function beyond exercising some args-related edge cases in tests are difficult/impossible to exercise otherwise, and its use should be con

(workers *Workers, jobArgs T, worker Worker[T])

Source from the content-addressed store, hash-verified

117// are difficult/impossible to exercise otherwise, and its use should be
118// considered internal only.
119func AddWorkerArgs[T JobArgs](workers *Workers, jobArgs T, worker Worker[T]) {
120 if err := workers.add(jobArgs, &workUnitFactoryWrapper[T]{worker: worker}); err != nil {
121 panic(err)
122 }
123}
124
125// AddWorkerSafely registers a worker on the provided Workers bundle. Unlike AddWorker,
126// AddWorkerSafely does not panic and instead returns an error if the worker

Callers 2

TestWorkFunction · 0.85
Test_Client_CommonFunction · 0.85

Calls 1

addMethod · 0.80

Tested by 2

TestWorkFunction · 0.68
Test_Client_CommonFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…