This cleans up the chain by which we call performasync through the several means. Fixes a bug where worker opts were not propagated to the `perform{in,async}` call. Kind of cool that demo.rs required no changes. Compiles and builds just fine.
I made max_retries(&self) a function on the Worker trait because Box<dyn Worker> is not Sized, therefore I can't call the T::opts() method, which would have been really nice. But, that's ok. I might need to re-think the worker opts pattern. Ideally we could rely on EnqueueOpts, but there's diverging perform functions where EnqueueOpts requires a class string, but WorkerOpts doesn't because it knows it ahead of time through the trait definition.
This cleans up the chain by which we call performasync through the several means. Fixes a bug where worker opts were not propagated to the `perform{in,async}` call. Kind of cool that demo.rs required no changes. Compiles and builds just fine.
I made
max_retries(&self)
a function on the Worker trait becauseBox<dyn Worker>
is notSized
, therefore I can't call theT::opts()
method, which would have been really nice. But, that's ok. I might need to re-think the worker opts pattern. Ideally we could rely on EnqueueOpts, but there's diverging perform functions where EnqueueOpts requires a class string, but WorkerOpts doesn't because it knows it ahead of time through the trait definition.