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.