Expand description
Spawn a detached tokio task that serves a tonic gRPC Router with
graceful shutdown signalling.
Uses tonic::transport::Server::serve_with_shutdown(...) so daemon-
style embedders can drain in-flight RPCs before exiting. The simpler
crate::Server::SpawnBindTask::Fn runs without a shutdown signal;
both shapes are kept side-by-side so embedders pick whichever matches
their lifecycle model.
§Lifecycle
- The task runs until
ShutdownSignalresolves OR the OS socket closes. - On
Ok(())exit, dev_log marks clean shutdown. - On
Err, dev_log captures the transport error.
§Choosing between the two helpers
| Need | Helper |
|---|---|
| Serve until process termination | SpawnBindTask |
| Serve until a signal fires (recommended for daemons) | SpawnBindTaskWithShutdown |
Functions§
- Fn
- Spawn a detached tokio task that serves
RouteronAddressuntilShutdownSignalresolves.