Trait LongLivedService

Source
pub trait LongLivedService<N: Network, DB: DB, VM: VMExecution>: Send + Sync {
    // Required methods
    fn execute<'life0, 'async_trait>(
        &'life0 mut self,
        network: Arc<RwLock<N>>,
        database: Arc<RwLock<DB>>,
        vm: Arc<RwLock<VM>>,
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn name(&self) -> &'static str;

    // Provided methods
    fn initialize<'life0, 'async_trait>(
        &'life0 mut self,
        network: Arc<RwLock<N>>,
        database: Arc<RwLock<DB>>,
        vm: Arc<RwLock<VM>>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn add_routes<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        my_topics: &'life1 [u8],
        queue: AsyncQueue<Message>,
        network: &'life2 Arc<RwLock<N>>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
}
Expand description

Service processes specified set of messages and eventually produces a DataSource query or update.

Service is allowed to propagate a message to the network as well.

Required Methods§

Source

fn execute<'life0, 'async_trait>( &'life0 mut self, network: Arc<RwLock<N>>, database: Arc<RwLock<DB>>, vm: Arc<RwLock<VM>>, ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

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

Returns service name.

Provided Methods§

Source

fn initialize<'life0, 'async_trait>( &'life0 mut self, network: Arc<RwLock<N>>, database: Arc<RwLock<DB>>, vm: Arc<RwLock<VM>>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn add_routes<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, my_topics: &'life1 [u8], queue: AsyncQueue<Message>, network: &'life2 Arc<RwLock<N>>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Implementors§

Source§

impl<N: Network, DB: DB, VM: VMExecution> LongLivedService<N, DB, VM> for ChainSrv<N, DB, VM>

Source§

impl<N: Network, DB: DB, VM: VMExecution> LongLivedService<N, DB, VM> for DataBrokerSrv

Source§

impl<N: Network, DB: DB, VM: VMExecution> LongLivedService<N, DB, VM> for MempoolSrv

Source§

impl<N: Network, DB: DB, VM: VMExecution> LongLivedService<N, DB, VM> for TelemetrySrv