pub trait Runtime: Send + Sync {
// Required methods
fn id(&self) -> RuntimeID;
fn subscribe_any<'life0, 'life1, 'async_trait>(
&'life0 self,
topic_name: &'life1 str,
topic_type: TypeId,
actor: Arc<dyn AnyActor>,
) -> Pin<Box<dyn Future<Output = Result<(), RuntimeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn publish_any<'life0, 'life1, 'async_trait>(
&'life0 self,
topic_name: &'life1 str,
topic_type: TypeId,
message: Arc<dyn Any + Send + Sync>,
) -> Pin<Box<dyn Future<Output = Result<(), RuntimeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn tx(&self) -> Sender<Event>;
fn transport<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Arc<dyn Transport>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn take_event_receiver<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Option<BoxEventStream<Event>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn run<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Abstract runtime that manages actor subscriptions, pub/sub delivery, and emission of protocol events. Implementations can provide different threading or transport strategies.
Required Methods§
fn id(&self) -> RuntimeID
fn subscribe_any<'life0, 'life1, 'async_trait>(
&'life0 self,
topic_name: &'life1 str,
topic_type: TypeId,
actor: Arc<dyn AnyActor>,
) -> Pin<Box<dyn Future<Output = Result<(), RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn publish_any<'life0, 'life1, 'async_trait>(
&'life0 self,
topic_name: &'life1 str,
topic_type: TypeId,
message: Arc<dyn Any + Send + Sync>,
) -> Pin<Box<dyn Future<Output = Result<(), RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn tx(&self) -> Sender<Event>
fn tx(&self) -> Sender<Event>
Local event processing sender. Agents receive this and emit protocol
Events through it. The runtime is responsible for forwarding them to
the owning Environment.