tobymao / saq

Simple Async Queues
https://saq-py.readthedocs.io/en/latest/
MIT License
532 stars 37 forks source link

Support settings factories #112

Closed pierec closed 7 months ago

pierec commented 7 months ago

Allow the settings objects imported during saq.worker.start() to be callable. This makes it possible to eliminate import-time side effects, especially if creating the settings objects is more involved.

In my case, I'm leveraging multiple queues and using a dependency injection framework to wire the saq.Queues a certain way. While I could sequester the settings objects to their separate modules, I find it more convenient to keep them together.

Let me know if this idea is OK and thank you for this neat little framework!