Cano: Simple & Fast Async Workflows in Rust ๐
Build powerful data processing pipelines with minimal code.
Cano is an async workflow engine that makes complex data processing simple. Whether you need to process one item or millions, Cano provides a clean API with minimal overhead for maximum performance.
โก Quick Start
Add Cano to your Cargo.toml
:
[]
= "0.1.0"
= { = "1.0", = ["full"] }
The Simplest Example
use *;
// Define your workflow states
;
async
That's it! You just ran your first Cano workflow.
๐ฏ Why Choose Cano?
- ๐๏ธ Simple API: A single
Node
trait handles everything - no complex type hierarchies - ๐ Simple Configuration: Fluent builder pattern makes setup intuitive
- ๐ Built-in Retries: Configurable retry logic for resilient workflows
- ๐พ Shared Storage: Thread-safe key-value store for data passing between nodes
- ๐ Complex Workflows: Chain nodes together into sophisticated state machine pipelines
- โก Type Safety: Enum-driven state transitions with compile-time safety
- ๐ High Performance: Minimal overhead with direct execution for maximum throughput
๐ How It Works
Cano is built around three simple concepts:
1. Nodes - Your Processing Units
A Node
trait is where your logic lives. Configure it once, and Cano handles the execution:
// Custom node with specific logic
;
2. Storage - Share Data Between Nodes
Use the built-in storage to pass data around your workflow:
let storage = new;
// Store some data
storage.put?;
storage.put?;
// Retrieve it later
let user_id: = storage.get;
let name: = storage.get;
3. Flows - Chain Nodes Together
Build complex workflows with state machine semantics:
let mut flow = new;
flow.register_node
.register_node
.register_node
.add_exit_states;
let result = flow.orchestrate.await?;
๐งฉ Advanced Features
Built-in Retry Logic
Every node includes configurable retry logic:
let config = new
.with_retries; // 5 retries, 1s wait between attempts
// Or use minimal retries for fast-failing nodes
let config = minimal; // 1 retry, no wait
Complex Workflows
Chain multiple nodes together to build sophisticated state machine pipelines:
let mut flow = new;
flow.register_node
.register_node
.register_node
.add_exit_states;
let result = flow.orchestrate.await?;
๐งช Testing & Benchmarks
Verify everything works and see performance metrics:
# Run all tests
# Run performance benchmarks
# Run all examples
Benchmark results are saved in target/criterion/
with detailed HTML reports.
๐ Documentation
- API Documentation - Complete API reference
- Examples Directory - Hands-on code examples
- Benchmarks - Performance testing and optimization
๐ค Contributing
We welcome contributions! Areas where you can help:
- ๐ Documentation - Improve guides and examples
- ๐ง Features - Add new storage backends or workflow capabilities
- โก Performance - Optimize hot paths and memory usage
- ๐งช Testing - Add test cases and edge case coverage
- ๐ Bug Fixes - Report and fix issues
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
Ready to build fast, reliable workflows? Start with the examples and let Cano handle the complexity while you focus on your business logic.