pub struct SensoriumLoop { /* private fields */ }Expand description
The SensoriumLoop orchestrates workers and gateways.
Flow: Gateway.start(db) → writes to conversations (processed=false) → Loop 1: polls conversations → matches message content against registered worker patterns in registration order; first match wins and is dispatched via tokio::spawn → Workers write ProcessEvents to process_events table → Loop 2: polls process_event_deliveries → retries delivery per gateway
Implementations§
Source§impl SensoriumLoop
impl SensoriumLoop
pub fn new() -> Self
pub fn with_conversations_poll_interval(self, secs: u64) -> Self
pub fn with_process_event_deliveries_poll_interval(self, secs: u64) -> Self
pub fn register_worker( &mut self, pattern: &str, worker: Arc<dyn Worker>, ) -> Result<()>
pub fn workers(&self) -> &[WorkerRegistration]
pub fn register_gateway(&mut self, gateway: Arc<dyn Gateway>)
pub async fn run(self, db: DatabaseConnection) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for SensoriumLoop
impl !UnwindSafe for SensoriumLoop
impl Freeze for SensoriumLoop
impl Send for SensoriumLoop
impl Sync for SensoriumLoop
impl Unpin for SensoriumLoop
impl UnsafeUnpin for SensoriumLoop
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