You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Illuminate\Bus\Dispatcher class initiate the PendingBatch and PendingChain instances directly, instead of using the container to resolve them.
This makes impossible to extend and swap these classes.
Practical example:
Having a multi-tenanted application, where each tenant has it's own queue (to mitigate noisy neighbour problem).
It is possible to define a dynamic, tenant-aware queue for individual jobs, it is not easily possible to do for batches and chains.
The developer has to specify the ->onQueue() modifier for every instance of batches and chains, which can be unnecessarily verbose.
If the framework would let the developer to re-bind the PendingBatch and/or PendingChain instances, the dynamic queue resolution could be easily done in one place - inside the tenant aware
descendant class.