Closed dnmellen closed 3 years ago
@dnmellen thanks! I'll dig into this next weekend.
Thanks again. This looks good, but would you mind adding an example to the README
? An adapted version of your OP here would be fine. If not, I can take care of it next week.
No problem! I can change the README
.
@Bogdanp I added some documentation to the README
. Feel free to complete or change anything you want for better clarification.
Thanks!
Thanks again. I made some minor changes on top and merged your changes with rebase. I'll cut a release in the next couple of weeks.
I'm trying to make the middleware initialization more flexible by adding a hooks system to be able to override the initial kwargs for some middleware during the
django_dramatiq
app initialization.The way you would provide this hook would be by overriding
django_dramatiq
django conf:If you want to add
dramatiq.middleware.GroupCallbacks
middleware, the name of the hook would bemiddleware_groupcallbacks_kwargs
. It takes the middleware name and converts it to lowercase (middleware_<middlewarename>_kwargs
).The hook is a classmethod that returns a
dict
containing the kwargs for that middleware.I was completely unable to create tests for this feature without changing the current test settings, but these changes are not changing any functionality unless you override the
DjangoDramatiqConfig
.