jamesmh / coravel

Near-zero config .NET library that makes advanced application features like Task Scheduling, Caching, Queuing, Event Broadcasting, and more a breeze!
https://docs.coravel.net/Installation/
MIT License
3.64k stars 243 forks source link

Unique name queues #294

Open farhadnowzari opened 2 years ago

farhadnowzari commented 2 years ago

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 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:

  1. 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.
  2. 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.
  3. 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.
farhadnowzari commented 1 year ago

Hi @jamesmh

Let me know if anything is needed regarding thie PR

skobbejakkals commented 7 months ago

Any news on this? This would be very useful.

jaisonass commented 3 months ago

Any update on this?

bCamba commented 3 months ago

This would be so useful if it got merged.