Skip to main content

TemporalScheduler

Struct TemporalScheduler 

Source
pub struct TemporalScheduler { /* private fields */ }
Expand description

Advanced temporal scheduler.

Implementations§

Source§

impl TemporalScheduler

Source

pub fn new() -> Self

Source

pub fn schedule( &mut self, channel_id: u64, sender: &str, content: &str, target: TemporalTarget, ) -> u64

Schedule a message for temporal delivery.

Source

pub fn register_condition<F>(&mut self, name: &str, evaluator: F)
where F: Fn(&str) -> bool + Send + Sync + 'static,

Register a condition evaluator.

Source

pub fn check_ready(&mut self) -> DeliveryCheck

Check which messages are ready for delivery.

Source

pub fn mark_delivered(&mut self, id: u64) -> bool

Mark a message as delivered.

Source

pub fn cancel(&mut self, id: u64) -> bool

Cancel a pending message.

Source

pub fn get(&self, id: u64) -> Option<&PendingMessage>

Get a pending message by ID.

Source

pub fn list_by_status(&self, status: &PendingStatus) -> Vec<&PendingMessage>

List all pending messages by status.

Source

pub fn stats(&self) -> (usize, usize, usize, usize)

Get total message counts: (waiting, delivered, cancelled, failed).

Source

pub fn expire_old(&mut self, max_age_secs: u64) -> usize

Expire messages older than max_age_secs.

Source

pub fn total_count(&self) -> usize

Get count of all messages.

Trait Implementations§

Source§

impl Debug for TemporalScheduler

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TemporalScheduler

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V