Consider allowing a SystemRunner::block_on()
future to listen for System::stop()
#588
Labels
SystemRunner::block_on()
future to listen for System::stop()
#588
I use
SystemRunner::block_on()
in mymain
function to run my http server. It is ergonomic since it passes through mystd::process::ExitCode
return value from my future. Now I would like to useSystem::current().stop()
to shutdown my server. Unfortunately, I don't see a way toawait
the stop event within myblock_on
future.One possible design:
I considered multiple workarounds, and am currently constructing an extra
Oneshot
channel and passing it around my application (losing the benefit ofSystem::current().stop()
working anywhere).The text was updated successfully, but these errors were encountered: