pub struct ProcessHandle<A: Actor + Referable> { /* private fields */ }
Expand description
A ProcHandle
implementation for procs managed as separate
OS processes via ProcessProcManager
.
This handle records the logical identity and connectivity of an external child process:
- its
ProcId
(unique identity on the host), - the proc’s
ChannelAddr
(address registered in the host router), - and the
ActorRef
of the agent actor spawned inside the proc.
Unlike LocalHandle
, this corresponds to a real OS process
launched by the manager. In this toy implementation the handle
does not own/monitor the Child
and there is no shutdown control
plane. It is a stable, clonable surface exposing the proc’s
identity, address, and agent reference so host code can interact
uniformly with local/external procs. terminate()
/kill()
are
intentionally Unsupported
here; process cleanup relies on
cmd.kill_on_drop(true)
when launching the child (the OS will
SIGKILL it if the handle is dropped).
The type bound A: Actor + Referable
comes from the
ProcHandle::Agent
requirement: Actor
because the agent
actually runs inside the proc, and Referable
because it must
be referenceable via ActorRef<A>
(i.e., safe to carry as a
typed remote reference).
Trait Implementations§
Source§impl<A: Actor + Referable> ProcHandle for ProcessHandle<A>
impl<A: Actor + Referable> ProcHandle for ProcessHandle<A>
Source§type Agent = A
type Agent = A
Agent must be both an Actor
(runs in the proc) and a
Referable
(so it can be referenced via ActorRef<A>
).
Source§fn ready<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ReadyError<Self::TerminalStatus>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn ready<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ReadyError<Self::TerminalStatus>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Resolves immediately. ProcessProcManager::spawn
returns this
handle only after the child has called back with (addr,
agent), i.e. after readiness.
Source§fn wait<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Self::TerminalStatus, WaitError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn wait<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Self::TerminalStatus, WaitError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Resolves immediately with ()
. This handle does not track
child lifecycle; there is no watcher in this implementation.
Source§type TerminalStatus = ()
type TerminalStatus = ()
Source§fn addr(&self) -> Option<ChannelAddr>
fn addr(&self) -> Option<ChannelAddr>
Source§fn agent_ref(&self) -> Option<ActorRef<Self::Agent>>
fn agent_ref(&self) -> Option<ActorRef<Self::Agent>>
Source§fn terminate<'life0, 'async_trait>(
&'life0 self,
_deadline: Duration,
) -> Pin<Box<dyn Future<Output = Result<(), TerminateError<Self::TerminalStatus>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn terminate<'life0, 'async_trait>(
&'life0 self,
_deadline: Duration,
) -> Pin<Box<dyn Future<Output = Result<(), TerminateError<Self::TerminalStatus>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
wait()
. Read moreSource§fn kill<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), TerminateError<Self::TerminalStatus>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn kill<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), TerminateError<Self::TerminalStatus>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
SIGKILL
. Also idempotent/race-safe; the terminal
outcome is the one observed by wait()
.Auto Trait Implementations§
impl<A> Freeze for ProcessHandle<A>
impl<A> RefUnwindSafe for ProcessHandle<A>
impl<A> Send for ProcessHandle<A>
impl<A> Sync for ProcessHandle<A>
impl<A> Unpin for ProcessHandle<A>
impl<A> UnwindSafe for ProcessHandle<A>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<A, M> Handler<IndexedErasedUnbound<M>> for A
impl<A, M> Handler<IndexedErasedUnbound<M>> for A
§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