| Crates.io | rukko |
| lib.rs | rukko |
| version | 0.1.1 |
| created_at | 2025-07-28 10:09:36.710853+00 |
| updated_at | 2025-11-18 11:36:49.151425+00 |
| description | A Rust library for communicating with JVM-based Pekko actors |
| homepage | |
| repository | https://github.com/hallyhaa/rukko |
| max_upload_size | |
| id | 1770955 |
| size | 194,615 |
A rust library for communicating with Apache Pekko JVM actors. Allows rust applications to send messages to and receive replies from Pekko actors.
Add Rukko to your Cargo.toml:
[dependencies]
rukko = "0.1.0"
tokio = "1.47.0"
use rukko::{ActorSystem, Message};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create an actor system
let system = ActorSystem::new("RustClient").await?;
// Connect to a remote Pekko actor
let remote_actor = system
.actor_selection("pekko://MySystem@127.0.0.1:25552/user/myActor")
.await?;
// Send a fire-and-forget message (tell pattern)
remote_actor.tell(Message::text("One-way message"));
// Send a message and wait for its response (ask pattern)
let response = remote_actor
.ask(Message::text("Hello from Rust!"))
.await?;
println!("Response: {:?}", response);
system.shutdown().await;
Ok(())
}
If your actor path is wrong or something else makes an ask hang until timeout, you will be waiting for 30 seconds for your error. If you can't wait half a minute, set your own timeout like this:
use tokio::time::Duration;
...
// Default timeout (30 seconds)
let response = actor.ask(message).await?;
// Custom timeout
let response = actor
.ask_with_timeout(important_question, Duration::from_secs(1))
.await?;
This project is licensed under the MIT License.
Contributions are welcome! Please feel free to submit issues and PRs.