Skip to content

Repository files navigation

reiny

This project is reiny. The way the data flows is just like rain.

reiny is a Rust SDK for distributed "grains" (processes) that communicate over Zenoh pub/sub. The organizing principle is type = topic: grains publish and subscribe by Rust type, never by topic string.

  • Publishing type T goes to reiny/<id>/T
  • Subscribing to type T receives reiny/*/T (the same type from every publisher)

The type → topic mapping is generated at build time by reiny-build (each grain's build.rs) from a Reiny.toml, so user code never names a topic string.

use reiny::prelude::*;
use crate::publications::Ping;        // generated by reiny-build
use crate::dependencies::pong::Pong;  // ditto

#[reiny::main]
async fn main(cloudy: Cloudy) -> reiny::Result<()> {
    let pings = cloudy.publish::<Ping>()?;
    let mut pongs = cloudy.subscribe::<Pong>()?;
    // ...
    Ok(())
}

Crates

Crate Role
reiny The SDK itself: Cloudy (the pub/sub handle) and the #[reiny::main] runtime
reiny-macros The #[reiny::main] proc-macro (used via reiny)
reiny-build build.rs helper: compiles protos from Reiny.toml and generates types/topics
reiny-launch Launcher library: spawns grain processes from a launch config's [grain] section
reiny-cli The reiny command: scaffold (new/init/add), check, build, run, compress

Getting started

Use the reiny CLI to scaffold a grain project.

cargo install reiny-cli   # installs the `reiny` command
reiny new my-grain
reiny check my-grain       # show the type → topic map (no build)

See examples/ for runnable demos (each is its own cargo workspace). For larger workspaces, examples/ping-pong-schema shows the [schema] shared-schema crate that compiles the message catalog once instead of per grain.

License

MIT. See LICENSE.

About

reiny: data flows is just like rain

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages