pub struct LocalHandle<A: Actor + Referable> { /* private fields */ }
Expand description
A lightweight ProcHandle
for procs managed in-process via
LocalProcManager
.
This handle wraps the minimal identifying state of a spawned proc:
- its
ProcId
(logical identity on the host), - the proc’s
ChannelAddr
(the address callers bind into the host router), and - the
ActorRef
to the agent actor hosted in the proc.
Unlike external handles, LocalHandle
does not manage an OS
child process. It provides a uniform surface (proc_id()
,
addr()
, agent_ref()
) and implements terminate()
/kill()
by
calling into the underlying Proc::destroy_and_wait
, i.e.,
proc-level shutdown.
Type parameter: A
is constrained by the ProcHandle::Agent
bound (Actor + Referable
).
Trait Implementations§
Source§impl<A: Actor + Referable> ProcHandle for LocalHandle<A>
impl<A: Actor + Referable> ProcHandle for LocalHandle<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,
Always resolves immediately: a local proc is created in-process and is usable as soon as the handle exists.
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,
Always resolves immediately with ()
: a local proc has no
external lifecycle to await. There is no OS child process
behind this handle.
Source§type TerminalStatus = ()
type TerminalStatus = ()
The type of terminal status produced when the proc exits. Read more
Source§fn addr(&self) -> Option<ChannelAddr>
fn addr(&self) -> Option<ChannelAddr>
The proc’s address (the one callers bind into the host
router).
Source§fn agent_ref(&self) -> Option<ActorRef<Self::Agent>>
fn agent_ref(&self) -> Option<ActorRef<Self::Agent>>
The agent actor reference hosted in the proc.
Source§fn terminate<'life0, 'async_trait>(
&'life0 self,
timeout: 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,
timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<(), TerminateError<Self::TerminalStatus>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Politely stop the proc before the deadline; managers that own
a child OS process may escalate to a forced kill at the
deadline. Idempotent and race-safe: concurrent callers
coalesce; the first terminal outcome wins and all callers
observe it via
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,
Force the proc down immediately. For in-process managers this
may abort actor tasks; for external managers this typically
sends
SIGKILL
. Also idempotent/race-safe; the terminal
outcome is the one observed by wait()
.Auto Trait Implementations§
impl<A> Freeze for LocalHandle<A>
impl<A> !RefUnwindSafe for LocalHandle<A>
impl<A> Send for LocalHandle<A>
impl<A> Sync for LocalHandle<A>
impl<A> Unpin for LocalHandle<A>
impl<A> !UnwindSafe for LocalHandle<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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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