Skip to main content

EventDomainDriver

Trait EventDomainDriver 

Source
pub trait EventDomainDriver:
    Debug
    + Send
    + Sync
    + 'static {
    // Required method
    fn begin_run(
        &self,
        domain: EventDomainId,
    ) -> Result<Box<dyn EventDomainRun>>;
}
Expand description

Runtime-owned factory for per-execution event-domain state.

§Examples

use tenferro_runtime::{EventDomainDriver, EventDomainId};

fn begin(
    driver: &dyn EventDomainDriver,
    domain: EventDomainId,
) -> tenferro_runtime::Result<()> {
    let mut run = driver.begin_run(domain)?;
    run.drain()
}

Required Methods§

Source

fn begin_run(&self, domain: EventDomainId) -> Result<Box<dyn EventDomainRun>>

Begin one isolated execution run for exactly domain.

§Errors

Returns a driver-defined typed error, such as crate::Error::Internal, when native queue, stream, or per-run event-state allocation fails, or when the domain cannot admit a new run.

Implementors§