raio-rs 0.2.0

A deterministic realtime async runtime
Documentation

Raio is a realtime robotic middleware that is deterministic. Time is treated as a first order primitive, integrated with the async / await syntax.

Get Started

Install Raio for Python 3.9 or later:

pip install raio-py

Raio is built with Rust, to add it as a dependency:

cargo add raio-rs

Hello World

Two nodes, each in its own process: Sender sends a value and Listener prints it.

import raio
from raio import MS, InputPort, Node, OutputPort, reaction, task

class Sender(Node):
    out = OutputPort[str]()

    @task
    async def send(self):
        await raio.wait(1 * MS)
        self.out.set("hello world")

class Listener(Node):
    inp = InputPort[str]()

    @reaction(inp)
    def show(self):
        print(self.inp.value)

sender, listener = Sender(), Listener()
raio.connect(sender.out, listener.inp)
raio.run(sender, listener)
$ python hello.py
hello world

Learn More

The documentation has a tutorial, the concepts behind Raio, and the API reference for Python and Rust.

Contributing

See CONTRIBUTING.md for how to build RAIO from source, run the tests, and make a release.