Exception
ShutdownException
Thrown into the coroutines of a run by phasync::shutdown(): the program is stopping. It is a CancelledException, so it behaves like one: the coroutine meets it at its wait, its finally blocks run, and cleanup that must wait belongs in phasync::finally(). Code that only needs to stop catches nothing, or CancelledException; code that must tell someone why catches this.
Class synopsis#
class ShutdownException extends CancelledException implements RethrowExceptionInterface, \Stringable, \Throwable {
}See also#
phasync::shutdownStop the program's coroutines: every coroutine but the caller, whatever frame it is in, gets$exception(a ShutdownException, which is a CancelledException) at its wait, asphasync::cancel()does, and has up to$windowseconds to clean up:finallyblocks, andphasync::finally()callbacks, which may wait. Returns how many are still running after that, for the caller to decide (for example to exit, dropping them).