Right now, we rely on some of the mechanics of mpsc channels to handle shutdown in places. We should move the code base over to using trigger to handle shutdown everywhere to improve readability.
1. Listen for shutdown in channel send/recieve
select! on listener for every channel Send and Receive, exiting if we get the signal to shut down
Eg: rather than send, select on listener to abort send if we need to exit:
Call trigger to signal shutdown if any task exits with an error - eg results consumer and event consumer. Run through codebase to cover all of these cases.
3. Doc Update
The shutdown section of the docs should be updated to reflect the simplified handling as part of this issue.
Right now, we rely on some of the mechanics of
mpsc
channels to handle shutdown in places. We should move the code base over to usingtrigger
to handle shutdown everywhere to improve readability.1. Listen for shutdown in channel send/recieve
select!
onlistener
for every channelSend
andReceive
, exiting if we get the signal to shut downEg: rather than send, select on listener to abort send if we need to exit:
2. Always trigger shutdown on error
Call
trigger
to signal shutdown if any task exits with an error - eg results consumer and event consumer. Run through codebase to cover all of these cases.3. Doc Update
The shutdown section of the docs should be updated to reflect the simplified handling as part of this issue.