Hi All, question about dispatchers and scopes. If we create our own scope, with our own context. Where we add a name, dispatcher, error handler, etc. Will the dispatcher be released when we close the scope/context? Or do we need to release the dispatcher separately?
s
Sam
08/24/2023, 3:08 PM
You would need to manage the dispatcher yourself, if it needs shutting down after use. The same dispatcher could be shared by many scopes, so the scope doesn’t try to shut it down. Cancelling a scope is just a shorthand for cancelling its
Job
— it doesn’t affect any of the other context elements belonging to the scope.
p
Peter Kievits
08/24/2023, 3:16 PM
Thanks, that's what I thought, but wanted to double check. We keep the context alive for the life of the jvm. However, it seems to be an issue for tests where we were detecting thread leaks.