pub struct RemoteProcessAlloc { /* private fields */ }
Expand description
A generalized implementation of an Alloc using one or more hosts running RemoteProcessAlloc for process allocation.
Implementations§
Source§impl RemoteProcessAlloc
impl RemoteProcessAlloc
Sourcepub async fn new(
spec: AllocSpec,
world_id: WorldId,
transport: ChannelTransport,
remote_allocator_port: u16,
initializer: impl RemoteProcessAllocInitializer + Send + Sync + 'static,
) -> Result<Self, Error>
pub async fn new( spec: AllocSpec, world_id: WorldId, transport: ChannelTransport, remote_allocator_port: u16, initializer: impl RemoteProcessAllocInitializer + Send + Sync + 'static, ) -> Result<Self, Error>
Create a new Alloc. initializer will be called on the first invocation of next() to obtain a list of allocate hosts. Then Allocate message will be sent to all RemoteProcessAllocator on all hosts. Heartbeats will be used to maintain health status of remote hosts.
Trait Implementations§
Source§impl Alloc for RemoteProcessAlloc
impl Alloc for RemoteProcessAlloc
Source§fn next<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Option<ProcState>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn next<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Option<ProcState>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Return the next proc event.
None
indicates that there are
no more events, and that the alloc is stopped.Source§fn world_id(&self) -> &WorldId
fn world_id(&self) -> &WorldId
The world id of this alloc, uniquely identifying the alloc.
Note: This will be removed in favor of a different naming scheme,
once we exise “worlds” from hyperactor core.
Source§fn transport(&self) -> ChannelTransport
fn transport(&self) -> ChannelTransport
The channel transport used the procs in this alloc.
Source§fn stop<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), AllocatorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stop<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), AllocatorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stop this alloc, shutting down all of its procs. A clean
shutdown should result in Stop events from all allocs,
followed by the end of the event stream.
Source§fn stop_and_wait<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), AllocatorError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
fn stop_and_wait<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), AllocatorError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
Stop this alloc and wait for all procs to stop. Call will
block until all ProcState events have been drained.
Auto Trait Implementations§
impl Freeze for RemoteProcessAlloc
impl !RefUnwindSafe for RemoteProcessAlloc
impl Send for RemoteProcessAlloc
impl Sync for RemoteProcessAlloc
impl Unpin for RemoteProcessAlloc
impl !UnwindSafe for RemoteProcessAlloc
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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>
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