pub struct StandaloneBackend { /* private fields */ }Expand description
Standalone process spawner backend.
Spawns processes directly using tokio::process::Command.
Tracks spawned processes and provides cleanup on stop.
Implementations§
Source§impl StandaloneBackend
impl StandaloneBackend
Sourcepub fn stop_tracked_child_by_handle_sync(
&self,
process: &SpawnedProcess,
) -> Result<()>
pub fn stop_tracked_child_by_handle_sync( &self, process: &SpawnedProcess, ) -> Result<()>
Synchronous bounded stop for a tracked direct child, run from the
launch-transaction guard’s Drop when the orchestration future is
cancelled (#1585).
This preserves the backend’s STRONGER tracked ownership instead of
downgrading adopted children to a blind by-PID signal: when the child
is still in the tracking map, termination goes through the retained
Child handle itself (start_kill + bounded try_wait reaping — the
sync counterpart of the tracked branch of Self::stop, same 5s
budget), and the map entry is surrendered only on a CONFIRMED reap. A
child no longer in the map is either already stopped by an earlier
confirmed stop or was never this backend’s: for a live untracked PID
this operation deliberately REFUSES to signal (a recycled PID could be
an unrelated process) and fails honestly instead; an untracked PID
already gone (kill(pid, None) → ESRCH — a liveness probe, never a
signal) is cleaned up. PID-artifact removal keeps the established
conditional semantics — the artifact is removed only while it still
names this child, a newer child’s artifact is preserved, and an actual
IO failure is an error, not success. Best effort within bounded
budgets, not a guarantee.
Trait Implementations§
Source§impl Default for StandaloneBackend
impl Default for StandaloneBackend
Source§impl Drop for StandaloneBackend
impl Drop for StandaloneBackend
Source§impl SpawnerBackend for StandaloneBackend
impl SpawnerBackend for StandaloneBackend
Source§fn spawn<'life0, 'async_trait>(
&'life0 self,
config: ProcessConfig,
) -> Pin<Box<dyn Future<Output = Result<SpawnedProcess>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn spawn<'life0, 'async_trait>(
&'life0 self,
config: ProcessConfig,
) -> Pin<Box<dyn Future<Output = Result<SpawnedProcess>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn stop<'life0, 'life1, 'async_trait>(
&'life0 self,
process: &'life1 SpawnedProcess,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn stop<'life0, 'life1, 'async_trait>(
&'life0 self,
process: &'life1 SpawnedProcess,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn is_running<'life0, 'life1, 'async_trait>(
&'life0 self,
process: &'life1 SpawnedProcess,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn is_running<'life0, 'life1, 'async_trait>(
&'life0 self,
process: &'life1 SpawnedProcess,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn stop_tracked_child_sync(&self, process: &SpawnedProcess) -> Result<()>
fn stop_tracked_child_sync(&self, process: &SpawnedProcess) -> Result<()>
Drop for cancellation cleanup where no
async runtime work is guaranteed (#1585). Backends that retain child
handles override this to stop through the retained handle — never a
blind by-PID signal; the default fails honestly.Source§fn backend_type(&self) -> &'static str
fn backend_type(&self) -> &'static str
Auto Trait Implementations§
impl Freeze for StandaloneBackend
impl !RefUnwindSafe for StandaloneBackend
impl Send for StandaloneBackend
impl Sync for StandaloneBackend
impl Unpin for StandaloneBackend
impl UnsafeUnpin for StandaloneBackend
impl !UnwindSafe for StandaloneBackend
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more