Skip to main content

Watcher

Trait Watcher 

Source
pub trait Watcher: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn kind(&self) -> &'static str;
    fn poll_interval(&self) -> Duration;
    fn poll<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        state: &'life1 ServerState,
    ) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Available on crate features serve and triggers only.
Expand description

One pollable watcher (object_arrival / queue_depth). Webhook is push, not polled, so it does not implement this.

Required Methods§

Source

fn name(&self) -> &str

Source

fn kind(&self) -> &'static str

Source

fn poll_interval(&self) -> Duration

Source

fn poll<'life0, 'life1, 'async_trait>( &'life0 mut self, state: &'life1 ServerState, ) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Do one cycle. Ok(true) = something fired; Ok(false) = idle.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Watcher for ObjectArrivalWatcher

Available on crate feature triggers-object-store only.
Source§

impl Watcher for QueueDepthWatcher

Available on crate features triggers-kafka or triggers-redis only.