Expand description
§Rukko
A Rust library for communicating with Pekko actors using the Artery TCP protocol.
This library provides a Rust implementation of the Pekko Artery remoting protocol, allowing Rust applications to send and receive (string) messages from JVM-based Pekko actors.
§Features
- Artery TCP protocol implementation
- String-based message support
- Connection management and error handling
§Logging
This library uses the tracing
crate for logging. To see log output,
initialize a tracing subscriber in your application:
// For text output:
tracing_subscriber::fmt::init();
For JSON output, enable the “json” feature in tracing-subscriber:
tracing-subscriber = { version = "0.3", features = ["json"] }
§Quick Start
use rukko::{ActorSystem, ActorSelection, Message};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Initialize logging (optional, but recommended for debugging)
tracing_subscriber::fmt::init();
let system = ActorSystem::new("MySystem").await?;
let remote_actor = system.actor_selection("pekko://RemoteSystem@127.0.0.1:25552/user/myActor").await?;
let message = Message::text("Hello, anybody there?");
let response = remote_actor.ask(message).await?;
println!("Response: {:?}", response);
Ok(())
}
Re-exports§
pub use actor::ActorSystem;
pub use actor::ActorSelection;
pub use protocol::Message;
pub use error::RukkoError;
pub use error::Result;