Skip to main content

PgmqEventHandler

Trait PgmqEventHandler 

Source
pub trait PgmqEventHandler: Send + Sync {
    // Required method
    fn handle_event<'life0, 'async_trait>(
        &'life0 self,
        event: PgmqNotifyEvent,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn handle_parse_error<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        channel: &'life1 str,
        payload: &'life2 str,
        error: PgmqNotifyError,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
    fn handle_connection_error<'life0, 'async_trait>(
        &'life0 self,
        error: PgmqNotifyError,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Trait for handling PGMQ notification events

Required Methods§

Source

fn handle_event<'life0, 'async_trait>( &'life0 self, event: PgmqNotifyEvent, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Handle a received PGMQ notification event

Provided Methods§

Source

fn handle_parse_error<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, channel: &'life1 str, payload: &'life2 str, error: PgmqNotifyError, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Handle a notification parsing error

Source

fn handle_connection_error<'life0, 'async_trait>( &'life0 self, error: PgmqNotifyError, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Handle connection issues

Implementors§