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,
remote_allocator_port: u16,
initializer: impl RemoteProcessAllocInitializer + Send + Sync + 'static,
) -> Result<Self, Error>
pub async fn new( spec: AllocSpec, world_id: WorldId, 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 client_router_addr(&self) -> ChannelAddr
fn client_router_addr(&self) -> ChannelAddr
For Tcp and Metatls, return a router address which has the same IP address
as the alloc’s bootstrap address, but with port set as 0. We do this
instead of using ChannelAddr::any is because we want alloc uses the
same IP address for all its frontend ports. In some environment, the
host can have public IP address and private IP address, and use the wrong
one could lead to port unreachable error.
For other channel types, this method still uses ChannelAddr::any.
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,
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
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,
Source§fn transport(&self) -> ChannelTransport
fn transport(&self) -> ChannelTransport
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,
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
§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