wick_trigger

Trait Trigger

Source
pub trait Trigger {
    // Required methods
    fn run<'life0, 'async_trait>(
        &'life0 self,
        name: String,
        runtime: Runtime,
        app_config: AppConfiguration,
        config: TriggerDefinition,
        resources: Arc<HashMap<BoundIdentifier, Resource>>,
        span: Span,
    ) -> Pin<Box<dyn Future<Output = Result<StructuredOutput, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn shutdown_gracefully<'async_trait>(
        self,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait;
    fn wait_for_done<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = StructuredOutput> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

fn run<'life0, 'async_trait>( &'life0 self, name: String, runtime: Runtime, app_config: AppConfiguration, config: TriggerDefinition, resources: Arc<HashMap<BoundIdentifier, Resource>>, span: Span, ) -> Pin<Box<dyn Future<Output = Result<StructuredOutput, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Start executing the trigger.

Source

fn shutdown_gracefully<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,

Shutdown a running trigger.

Source

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

Wait for the trigger to finish.

Implementors§