You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way to make Rocket break its main loop and quit the application gracefully?
I'm trying to convert my Rocket application to a Windows Service. A Windows Service apparently needs Rocket application to be spawned in a different thread, and reserve its main thread to receive/process Windows Service events. To properly handle the Stop signal, the main application should terminate the Rocket thread gracefully, so I can't simply use std::process:exit().
I couldn't find any mention of how to quit the Rocket app. The documentation only says that the Rocket::launch() function never returns, so this might be unsupported?
Currently I'm using conditional compilation on Windows; I'm importing kernel32 crate, and I'm performing an unsafe call to TerminateThread. It's nowhere near the proper solution and I'd like to change it.
The text was updated successfully, but these errors were encountered:
antekone
changed the title
Clean termination of Rocket application
Graceful termination of Rocket application
Sep 18, 2018
Clean shutdown is desired at some point (see #180). Today, though, I think non-graceful termination through TerminateThread or spawning a Rocket server in a child process to kill later is the only working solution.
I'm using Rocket 0.3.16.
Is there a way to make Rocket break its main loop and quit the application gracefully?
I'm trying to convert my Rocket application to a Windows Service. A Windows Service apparently needs Rocket application to be spawned in a different thread, and reserve its main thread to receive/process Windows Service events. To properly handle the Stop signal, the main application should terminate the Rocket thread gracefully, so I can't simply use
std::process:exit()
.I couldn't find any mention of how to quit the Rocket app. The documentation only says that the
Rocket::launch()
function never returns, so this might be unsupported?Currently I'm using conditional compilation on Windows; I'm importing
kernel32
crate, and I'm performing anunsafe
call toTerminateThread
. It's nowhere near the proper solution and I'd like to change it.The text was updated successfully, but these errors were encountered: