Currently Sage allows async steps that spin up a task supervised under Sage.AsyncTransactionSupervisor. Because Sage is a dep of Blog, on shutdown Blog will shutdown before Sage does.
That means if an async step interacts with a process under Blog's supervision tree and you are using some sort of rolling deploy you can enter the following scenario:
Blog starts async task
Sage starts doing that task
Blog shuts down
Sage tries to interact with a process in Blog and can't - so it crashes / errors.
Possible Solutions
Make Sage a library and allow users to start it themselves?
Allow the user to pass in their own supervisor under which it can start the async steps.
Imagine an app called Blog that uses Sage.
Currently Sage allows async steps that spin up a task supervised under Sage.AsyncTransactionSupervisor. Because Sage is a dep of Blog, on shutdown Blog will shutdown before Sage does.
That means if an async step interacts with a process under Blog's supervision tree and you are using some sort of rolling deploy you can enter the following scenario:
Possible Solutions
This PR does 2