/scallion

Distributed task queue

Primary LanguageRustMIT LicenseMIT

Scallion

Distributed task queue

Minimal example

#[derive(Debug, Serialize, Deserialize)]
struct Add {
    x: f64,
    y: f64,
}

#[async_trait]
impl Task for Add {
    type Output = f64;
    async fn task(self: Box<Self>, _: ConsumerState) -> Result<Self::Output, Box<dyn Error + Send + Sync + 'static>> {
        Ok(self.x + self.y)
    }
}

Run example

Run consumer:

cargo run --release --features rkyv,protobuf --example app -- consume

Produce task:

cargo run --release --features rkyv,protobuf --example app -- produce ping