Closed maxcountryman closed 1 month ago
/cc @kirillsalykin I ended up using a cancellation token here instead (Notify
could also work, but it's not cancel safe and requires pinning to work as I'd want it).
From here we could add shutdown
or similar to the worker. Then the job could wrap that. Likewise with the scheduler I think.
Let me know what you think.
LGTM
This refactors worker shutdown to use a cancellation token to signal shutdown. By doing so, we can avoid managing an atomic bool. It also makes it possible to provide addtional methods, such as a
shutdown
method, on the worker itself to signal shutdown.