Skip to content

Solved my dramatiq puzzle, two times!

It took me some time and a push into the right direction to solve my puzzle.

My first solution is a fix for my all actors in one worker. The fix here was to remove the dramatiq setup call from within each actor and to centralize it in the one worker file before importing the actors per context.

My second solution is a fix for my one worker per context. The fix here was to add a state to the dramatiq setup to prevent creating brokers instances after broker instances.

With my code, you are now able to create python project that uses dramatiq and has multiple actors defined in multiple worker files.

Sounds simple but took me more than an week. Hope it prevents at least one to waste that time!