A new extension method is added to the ServicesCollection, AddQueues.
This method will get an action which has the IServicesCollection as the parameter so you can use AddQueue as you would do normally.
Also it will inject IQueues into DI so you can query for the registered queues.
The ToDos in my opinion are as follow:
On AddQueues method it should NOT be possible that inside the action we can again call AddQueues . Maybe we can replace the IServicesCollection with QueuesOption and this class will provide the AddQueue method.
At the moment in Coravel it is configurable that how often the worker run the single queue but since we have now multiple queues I think this should also have a configuration in appsettings.json. If they specify the old config it would be apply for all but if they specify the name of the queue as the key and the value will be the delay inside appsettings we can adjust each queue.
The queue name at the moment is not really unique. On adding them to the DI we should check if the same name is already added or not and handle the error accordingly.
The issue related to this PR is. https://github.com/jamesmh/coravel/issues/284
A new extension method is added to the ServicesCollection,
AddQueues
. This method will get an action which has theIServicesCollection
as the parameter so you can useAddQueue
as you would do normally. Also it will injectIQueues
intoDI
so you can query for the registered queues.The ToDos in my opinion are as follow:
AddQueues
method it should NOT be possible that inside the action we can again callAddQueues
. Maybe we can replace the IServicesCollection withQueuesOption
and this class will provide theAddQueue
method.appsettings.json
. If they specify the old config it would be apply for all but if they specify the name of thequeue
as the key and the value will be the delay insideappsettings
we can adjust each queue.DI
we should check if the same name is already added or not and handle the error accordingly.