pub trait UpdateProcessor: Send + Sync {
// Required method
fn do_process_update<'life0, 'async_trait>(
&'life0 self,
update: Arc<Update>,
coroutine: Pin<Box<dyn Future<Output = ()> + Send>>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn initialize<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
An abstract base for update processors.
Implementations control how update coroutines are driven (e.g. immediately awaited, batched, prioritised, etc.).
The process_update method is final – it
acquires the internal semaphore and then delegates to
do_process_update.
Required Methods§
Sourcefn do_process_update<'life0, 'async_trait>(
&'life0 self,
update: Arc<Update>,
coroutine: Pin<Box<dyn Future<Output = ()> + Send>>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn do_process_update<'life0, 'async_trait>(
&'life0 self,
update: Arc<Update>,
coroutine: Pin<Box<dyn Future<Output = ()> + Send>>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Custom implementation of how to process an update. Must be implemented by the concrete type.
Warning: This method is called by
process_update. It should not be called
manually.