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
ActorRefof 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
has no graceful shutdown control plane or exit monitor. It retains
access to the manager’s child registry so terminate() and kill()
can remove, kill, and reap the process when a host spawn fails.
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>
None before ready() completes.
Guaranteed to return Some after ready() succeeds. Read moreSource§fn agent_ref(&self) -> Option<ActorRef<Self::Agent>>
fn agent_ref(&self) -> Option<ActorRef<Self::Agent>>
None before ready() completes. Guaranteed to return Some
after ready() succeeds. Read moreSource§fn terminate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_cx: &'life1 (impl 'async_trait + Actor),
_deadline: Duration,
_reason: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), TerminateError<Self::TerminalStatus>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn terminate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_cx: &'life1 (impl 'async_trait + Actor),
_deadline: Duration,
_reason: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), TerminateError<Self::TerminalStatus>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: '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> !RefUnwindSafe for ProcessHandle<A>
impl<A> !UnwindSafe for ProcessHandle<A>
impl<A> Freeze for ProcessHandle<A>
impl<A> Send for ProcessHandle<A>
impl<A> Sync for ProcessHandle<A>
impl<A> Unpin for ProcessHandle<A>
impl<A> UnsafeUnpin for ProcessHandle<A>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
§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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].