pub struct ProcActor { /* private fields */ }
Expand description
ProcActor manages a single proc. It is responsible for managing the lifecycle of all of the proc’s actors, and to route messages accordingly.
Implementations§
Source§impl ProcActor
impl ProcActor
Sourcepub async fn bootstrap(
proc_id: ProcId,
world_id: WorldId,
listen_addr: ChannelAddr,
bootstrap_addr: ChannelAddr,
supervision_update_interval: Duration,
labels: HashMap<String, String>,
lifecycle_mode: ProcLifecycleMode,
) -> Result<BootstrappedProc, Error>
pub async fn bootstrap( proc_id: ProcId, world_id: WorldId, listen_addr: ChannelAddr, bootstrap_addr: ChannelAddr, supervision_update_interval: Duration, labels: HashMap<String, String>, lifecycle_mode: ProcLifecycleMode, ) -> Result<BootstrappedProc, Error>
Bootstrap a proc actor with the provided proc id. The bootstrapped proc actor will use the provided listen address to serve its mailbox, while the bootstrap address is used to register with the system actor.
Sourcepub async fn try_bootstrap(
proc_id: ProcId,
world_id: WorldId,
listen_addr: ChannelAddr,
bootstrap_addr: ChannelAddr,
supervisor_actor_ref: ActorRef<ProcSupervisor>,
supervision_update_interval: Duration,
labels: HashMap<String, String>,
lifecycle_mode: ProcLifecycleMode,
) -> Result<BootstrappedProc, Error>
pub async fn try_bootstrap( proc_id: ProcId, world_id: WorldId, listen_addr: ChannelAddr, bootstrap_addr: ChannelAddr, supervisor_actor_ref: ActorRef<ProcSupervisor>, supervision_update_interval: Duration, labels: HashMap<String, String>, lifecycle_mode: ProcLifecycleMode, ) -> Result<BootstrappedProc, Error>
Attempt to bootstrap a proc actor with the provided proc id. The bootstrapped proc actor will use the provided listen address to serve its mailbox, while the bootstrap address is used to register with the system actor.
Sourcepub async fn bootstrap_for_proc(
proc: Proc,
world_id: WorldId,
listen_addr: ChannelAddr,
bootstrap_addr: ChannelAddr,
supervisor_actor_ref: ActorRef<ProcSupervisor>,
supervision_update_interval: Duration,
labels: HashMap<String, String>,
lifecycle_mode: ProcLifecycleMode,
) -> Result<BootstrappedProc, Error>
pub async fn bootstrap_for_proc( proc: Proc, world_id: WorldId, listen_addr: ChannelAddr, bootstrap_addr: ChannelAddr, supervisor_actor_ref: ActorRef<ProcSupervisor>, supervision_update_interval: Duration, labels: HashMap<String, String>, lifecycle_mode: ProcLifecycleMode, ) -> Result<BootstrappedProc, Error>
Bootstrap a proc actor with the provided proc. The bootstrapped proc actor will use the provided listen address to serve its mailbox, while the bootstrap address is used to register with the system actor.
Trait Implementations§
Source§impl Actor for ProcActor
impl Actor for ProcActor
Source§type Params = ProcActorParams
type Params = ProcActorParams
Source§fn new<'async_trait>(
params: ProcActorParams,
) -> Pin<Box<dyn Future<Output = Result<Self, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
fn new<'async_trait>(
params: ProcActorParams,
) -> Pin<Box<dyn Future<Output = Result<Self, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
Source§fn init<'life0, 'life1, 'async_trait>(
&'life0 mut self,
this: &'life1 Instance<Self>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn init<'life0, 'life1, 'async_trait>(
&'life0 mut self,
this: &'life1 Instance<Self>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn spawn<'life0, 'async_trait>(
cap: &'life0 (impl CanSpawn + 'async_trait),
params: Self::Params,
) -> Pin<Box<dyn Future<Output = Result<ActorHandle<Self>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn spawn<'life0, 'async_trait>(
cap: &'life0 (impl CanSpawn + 'async_trait),
params: Self::Params,
) -> Pin<Box<dyn Future<Output = Result<ActorHandle<Self>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Instance
).
The spawned actor will be supervised by the parent (spawning) actor.Source§fn spawn_detached<'async_trait>(
params: Self::Params,
) -> Pin<Box<dyn Future<Output = Result<ActorHandle<Self>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
fn spawn_detached<'async_trait>(
params: Self::Params,
) -> Pin<Box<dyn Future<Output = Result<ActorHandle<Self>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
Source§fn spawn_server_task<F>(future: F) -> JoinHandle<<F as Future>::Output>
fn spawn_server_task<F>(future: F) -> JoinHandle<<F as Future>::Output>
Source§fn handle_supervision_event<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
_this: &'life1 Instance<Self>,
_event: &'life2 ActorSupervisionEvent,
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn handle_supervision_event<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
_this: &'life1 Instance<Self>,
_event: &'life2 ActorSupervisionEvent,
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Source§fn handle_undeliverable_message<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Instance<Self>,
__arg2: Undeliverable<MessageEnvelope>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn handle_undeliverable_message<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Instance<Self>,
__arg2: Undeliverable<MessageEnvelope>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Source§impl Handler<ActorSupervisionEvent> for ProcActor
impl Handler<ActorSupervisionEvent> for ProcActor
Source§impl Handler<MailboxAdminMessage> for ProcActor
impl Handler<MailboxAdminMessage> for ProcActor
Source§impl Handler<ProcMessage> for ProcActor
impl Handler<ProcMessage> for ProcActor
Source§impl MailboxAdminMessageHandler for ProcActor
impl MailboxAdminMessageHandler for ProcActor
Source§fn update_address<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, Self>,
proc_id: ProcId,
addr: ChannelAddr,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_address<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, Self>,
proc_id: ProcId,
addr: ChannelAddr,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§impl Named for ProcActor
impl Named for ProcActor
Source§fn typename() -> &'static str
fn typename() -> &'static str
Source§fn typehash() -> u64
fn typehash() -> u64
Source§fn typeid() -> TypeId
fn typeid() -> TypeId
Source§fn port() -> u64
fn port() -> u64
Source§impl ProcMessageHandler for ProcActor
impl ProcMessageHandler for ProcActor
Source§fn joined<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_cx: &'life1 Context<'_, Self>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn joined<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_cx: &'life1 Context<'_, Self>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn state<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_cx: &'life1 Context<'_, Self>,
) -> Pin<Box<dyn Future<Output = Result<ProcState, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn state<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_cx: &'life1 Context<'_, Self>,
) -> Pin<Box<dyn Future<Output = Result<ProcState, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn spawn<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, Self>,
actor_type: String,
actor_name: String,
params_data: Data,
status_port: PortRef<Index>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn spawn<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, Self>,
actor_type: String,
actor_name: String,
params_data: Data,
status_port: PortRef<Index>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn spawn_proc<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_cx: &'life1 Context<'_, Self>,
env: Environment,
world_id: WorldId,
proc_ids: Vec<ProcId>,
world_size: usize,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn spawn_proc<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_cx: &'life1 Context<'_, Self>,
env: Environment,
world_id: WorldId,
proc_ids: Vec<ProcId>,
world_size: usize,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn update_supervision<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, Self>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_supervision<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, Self>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn stop<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, Self>,
timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<ProcStopResult, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn stop<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, Self>,
timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<ProcStopResult, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn snapshot<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_cx: &'life1 Context<'_, Self>,
) -> Pin<Box<dyn Future<Output = Result<ProcSnapshot, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn snapshot<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_cx: &'life1 Context<'_, Self>,
) -> Pin<Box<dyn Future<Output = Result<ProcSnapshot, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn local_addr<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_cx: &'life1 Context<'_, Self>,
) -> Pin<Box<dyn Future<Output = Result<ChannelAddr, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn local_addr<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_cx: &'life1 Context<'_, Self>,
) -> Pin<Box<dyn Future<Output = Result<ChannelAddr, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn py_spy_dump<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_cx: &'life1 Context<'_, Self>,
config: PySpyConfig,
) -> Pin<Box<dyn Future<Output = Result<StackTrace, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn py_spy_dump<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_cx: &'life1 Context<'_, Self>,
config: PySpyConfig,
) -> Pin<Box<dyn Future<Output = Result<StackTrace, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
impl RemoteActor for ProcActor
impl RemoteHandles<MailboxAdminMessage> for ProcActor
impl RemoteHandles<ProcMessage> for ProcActor
impl RemoteHandles<Signal> for ProcActor
Auto Trait Implementations§
impl Freeze for ProcActor
impl !RefUnwindSafe for ProcActor
impl Send for ProcActor
impl Sync for ProcActor
impl Unpin for ProcActor
impl !UnwindSafe for ProcActor
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
Source§impl<A> Handler<Undeliverable<MessageEnvelope>> for Awhere
A: Actor,
impl<A> Handler<Undeliverable<MessageEnvelope>> for Awhere
A: Actor,
Source§fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, A>,
message: Undeliverable<MessageEnvelope>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
A: 'async_trait,
fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, A>,
message: Undeliverable<MessageEnvelope>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
A: 'async_trait,
§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