| Crates.io | allora-runtime |
| lib.rs | allora-runtime |
| version | 0.0.2 |
| created_at | 2025-11-26 04:28:09.274988+00 |
| updated_at | 2025-11-26 16:58:42.1948+00 |
| description | Allora runtime and DSL implementation (internal crate). |
| homepage | https://github.com/fialucci/allora |
| repository | https://github.com/fialucci/allora |
| max_upload_size | |
| id | 1950934 |
| size | 182,051 |
Runtime and channels for the Allora integration library.
allora-runtime provides the execution engine and channel abstractions used to run Allora integration flows. It
manages channels, scheduling, and glue code so messages (exchanges) can move between services and processors in an
async Rust application.
Most applications interact with the runtime through the top-level allora crate, but you can depend on
allora-runtime directly when you need finer control over channels or want to embed the runtime into an existing
application.
allora-runtime?allora-runtime sits between the low-level primitives in allora-core and the user-facing allora facade:
allora)It focuses on running message flows rather than defining low-level EIP patterns.
Channels are the primary way messages move between components in Allora. This crate supports several channel types
(re-exported through the allora facade):
Under the hood, these implement traits from allora-core such as Channel, PollableChannel, and
SubscribableChannel.
A minimal example of using the runtime and channels via the top-level allora facade. This shows how to:
Exchange through a channeluse allora::{Channel, DirectChannel, Exchange, Message, QueueChannel, Result, Runtime};
#[tokio::main]
async fn main() -> Result<()> {
// Build and start the runtime (configuration loading is handled inside Runtime)
let rt = Runtime::new().run()?;
// These channel names must match your Allora configuration
let input: DirectChannel = rt.channel("input_channel");
let output: QueueChannel = rt.channel("output_channel");
// Send a message into the flow
input
.send(Exchange::new(Message::from_text("World")))
.await?;
// In a real app you might await a signal or use a loop; here we just sleep briefly
tokio::time::sleep(std::time::Duration::from_millis(50)).await;
// Consume the processed message from the output channel
if let Some(ex) = output.try_receive().await {
println!("Received: {}", ex.in_msg.body_text().unwrap_or("(empty)"));
}
Ok(())
}
This example uses the Runtime to obtain channels and move an Exchange through a simple flow. In a larger
application, services and HTTP adapters would be wired in through configuration or builder APIs.
Most users should start with the allora crate, which re-exports Runtime, channel types, and higher-level APIs.
Reach for allora-runtime directly when you:
If you just want to define services, configure channels, and run flows, prefer allora.
allora-runtime is one piece of the Allora ecosystem:
allora-core – message model, exchanges, channels traits, processors, and low-level EIP primitivesallora-runtime (this crate) – runtime engine and channel management for executing flowsallora-http – HTTP inbound/outbound adapters that plug into channels managed by the runtimeallora-macros – proc macros like #[service] for registering services with the runtime inventoryallora – top-level facade that re-exports these pieces into a single user-facing APICheck the allora crate for high-level project status and roadmap.
Licensed under Apache-2.0. See the LICENSE file in the repository for details.