rusty_chain 0.1.18

This library abstracts over functional processing units called `chain links`. Each link in the chain is meant to be independent, immutable, idempotent, and highly testable.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
#[async_trait::async_trait]
pub trait ChainLink {
    type TInput;
    type TOutput;

    async fn push(&self, input: std::sync::Arc<tokio::sync::RwLock<Self::TInput>>);
    async fn push_raw(&self, input: Self::TInput);
    async fn push_if_empty(&self, input: std::sync::Arc<tokio::sync::RwLock<Self::TInput>>);
    async fn push_raw_if_empty(&self, input: Self::TInput);
    async fn try_pop(&self) -> Option<std::sync::Arc<tokio::sync::RwLock<Self::TOutput>>>;
    async fn process(&self) -> bool;
}