pub struct EngineProcessManager { /* private fields */ }Expand description
Manages the rivet-engine subprocess.
The engine is intentionally orphaned: dropping the manager (or having the host process exit) must NOT terminate the engine. This lets a dev-server restart of the rivetkit host reattach to the same long-lived engine and keep all in-flight actor state. To honor that contract:
Command::kill_on_dropis left at its default (false) so the tokioChilddoes not send SIGKILL on drop.- Stdout and stderr are routed to log files at spawn time so the engine’s write fds remain valid after the host’s pipes close.
- On startup we probe the configured endpoint and reuse a healthy engine instead of spawning a duplicate.
When we spawn the engine, watcher holds a tokio task that owns the
Child and awaits child.wait() so we get a log line if the engine dies
while rivetkit is still running. On Drop we abort the watcher; aborting
drops the Child without killing it (kill_on_drop=false), so the engine
stays running and gets reparented to init when rivetkit exits.
watcher is None when we attached to an already-running engine.
Implementations§
Source§impl EngineProcessManager
impl EngineProcessManager
pub async fn start_or_reuse( config: EngineResolverConfig, ) -> Result<EngineProcessManager, Error>
Trait Implementations§
Source§impl Debug for EngineProcessManager
impl Debug for EngineProcessManager
Source§impl Drop for EngineProcessManager
impl Drop for EngineProcessManager
Auto Trait Implementations§
impl Freeze for EngineProcessManager
impl RefUnwindSafe for EngineProcessManager
impl Send for EngineProcessManager
impl Sync for EngineProcessManager
impl Unpin for EngineProcessManager
impl UnsafeUnpin for EngineProcessManager
impl UnwindSafe for EngineProcessManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more