pub struct ProcessProcManager<A> { /* private fields */ }Expand description
A ProcManager that manages each proc as a separate OS process (test-only toy).
This implementation launches a child via Command and relies on
kill_on_drop(true) so that children are SIGKILLed if the manager
(or host) drops. There is no proc control plane (no RPC to a
proc agent for shutdown) and no exit monitor wired here.
Consequently:
terminate()andkill()returnUnsupported.wait()is trivial (no lifecycle observation).
It follows a simple protocol:
Each process is launched with the following environment variables:
HYPERACTOR_HOST_BACKEND_ADDR: the backend address to which all messages are forwarded,HYPERACTOR_HOST_PROC_ID: the proc id to assign the launched proc, andHYPERACTOR_HOST_CALLBACK_ADDR: the channel address with which to return the proc’s address
The launched proc should also spawn an actor to manage it - the details of this are implementation dependent, and outside the scope of the process manager.
The function [boot_proc] provides a convenient implementation of the
protocol.
Implementations§
Source§impl<A> ProcessProcManager<A>
impl<A> ProcessProcManager<A>
Trait Implementations§
Source§impl<A> Drop for ProcessProcManager<A>
impl<A> Drop for ProcessProcManager<A>
Source§impl<A> ProcManager for ProcessProcManager<A>
impl<A> ProcManager for ProcessProcManager<A>
Source§type Handle = ProcessHandle<A>
type Handle = ProcessHandle<A>
Concrete handle type this manager returns.
Source§fn transport(&self) -> ChannelTransport
fn transport(&self) -> ChannelTransport
The preferred transport for this ProcManager.
In practice this will be
ChannelTransport::Local
for testing, and ChannelTransport::Unix for external
processes.Source§fn spawn<'life0, 'async_trait>(
&'life0 self,
proc_id: ProcAddr,
forwarder_addr: ChannelAddr,
_config: (),
) -> Pin<Box<dyn Future<Output = Result<Self::Handle, HostError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn spawn<'life0, 'async_trait>(
&'life0 self,
proc_id: ProcAddr,
forwarder_addr: ChannelAddr,
_config: (),
) -> Pin<Box<dyn Future<Output = Result<Self::Handle, HostError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Spawn a new proc with the provided proc address. The proc should use
forwarder_addr for messages destined outside of itself. The returned
handle exposes the address that accepts messages for the proc. Read moreAuto Trait Implementations§
impl<A> Freeze for ProcessProcManager<A>
impl<A> !RefUnwindSafe for ProcessProcManager<A>
impl<A> Send for ProcessProcManager<A>where
A: Send,
impl<A> Sync for ProcessProcManager<A>where
A: Sync,
impl<A> Unpin for ProcessProcManager<A>where
A: Unpin,
impl<A> UnsafeUnpin for ProcessProcManager<A>
impl<A> !UnwindSafe for ProcessProcManager<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
Mutably borrows from an owned value. Read more
§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>
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
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>,
Applies the layer to a service and wraps it in [
Layered].