blueprint-router 0.1.0-alpha.6

Job routing utilities for the Blueprint SDK
Documentation

Blueprint SDK Job Router

This crate provides the [Router], which is used to route jobs to different handlers based on their JobId.

Usage

use blueprint_sdk::Router;
use blueprint_sdk::job::JobWithoutContextExt;
use blueprint_sdk::{IntoJobResult, JobResult};

// Define a job function. See [`Job`] for more details
async fn my_job() -> String {
    String::from("Hello world!")
}

// Give the job some kind of ID. Many types can be converted
// into a [`JobId`]. See [`JobId`] for more details
const MY_JOB_ID: u32 = 0;

let router = Router::new().route(MY_JOB_ID, my_job);

# let _: Router = router;

See also

Features