net-component 0.1.0

This crate defines core traits and types for the components in net-timescale. The component in the context is a separate microservice which handles each own type of requests from net-gateway - rest server. Because of the amount of such services we decided to create a trait which defines the skeleton of each one to reduce the code duplicate.
Documentation
1
2
3
4
5
6
use std::error::Error;

#[async_trait::async_trait]
pub trait Component: Send + Sync {
    async fn run(&self) -> Result<(), Box<dyn Error + Send + Sync>>;
}