pub struct ActorRuntime;Expand description
§ActorRuntime
Coordinates the execution and lifecycle of a single WebAssembly actor within the Theater system.
ActorRuntime provides static methods for building and running actors. It manages the various
components that make up an actor’s execution environment, including handlers and communication
channels. It’s responsible for starting the actor, setting up its capabilities via handlers,
executing operations, and ensuring proper shutdown.
Implementations§
Source§impl ActorRuntime
impl ActorRuntime
pub async fn build_actor_resources( id: TheaterId, name: String, wasm_bytes: Vec<u8>, pack_runtime: AsyncRuntime, chain: Arc<SyncRwLock<StateChain>>, handler_registry: HandlerRegistry, theater_tx: Sender<TheaterCommand>, operation_tx: Sender<ActorOperation>, info_tx: Sender<ActorInfo>, control_tx: Sender<ActorControl>, actor_phase_manager: ActorPhaseManager, actor_instance_wrapper: Arc<RwLock<Option<PackInstance>>>, initial_state: Value, ) -> Result<(ShutdownController, Vec<JoinHandle<()>>), ActorRuntimeError>
pub async fn start( id: TheaterId, name: String, wasm_bytes: Vec<u8>, pack_runtime: AsyncRuntime, chain: Arc<SyncRwLock<StateChain>>, handler_registry: HandlerRegistry, theater_tx: Sender<TheaterCommand>, operation_rx: Receiver<ActorOperation>, operation_tx: Sender<ActorOperation>, info_rx: Receiver<ActorInfo>, info_tx: Sender<ActorInfo>, control_rx: Receiver<ActorControl>, control_tx: Sender<ActorControl>, initial_state: Value, setup_result_tx: Option<Sender<Result<(), String>>>, )
Auto Trait Implementations§
impl Freeze for ActorRuntime
impl RefUnwindSafe for ActorRuntime
impl Send for ActorRuntime
impl Sync for ActorRuntime
impl Unpin for ActorRuntime
impl UnsafeUnpin for ActorRuntime
impl UnwindSafe for ActorRuntime
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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