Replies: 3 comments
-
|
Beta Was this translation helpful? Give feedback.
-
You need another scope to do anything after runtime shutdown. If you just straight exit main when runtime shutdown you can't do any meaningful work. That said in general you are encouraged to do all the work inside the actix-runtime context. Design your clean up logic to fit it could be a better solution overall. |
Beta Was this translation helpful? Give feedback.
-
Are there any examples for this? I need to shut down background workers but I know of no way to react to the server shutting down or even receive a notification that it does so. And how should I handle shutting down IO? In theory it might take ages to write the last 10 bytes of an operation and stopping the System will interrupt the write process and corrupt the file. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I noticed that
ServerBuilder
is not dropped after the server is stopped. It doesn't matter whetherServerBuilder::exit
is true andSystem::current().stop()
is called (it really should happen then shouldn't it?) or not. Furthermore, theServerBuilder
future can never complete because it returnsPending
even when the command receiver returnsNone
!Is this intended? I'm relying on
web::Data<T>
being dropped after the server shuts down, butServerBuilder
holds the last reference to it forever.Beta Was this translation helpful? Give feedback.
All reactions