1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//! # dactor-ractor
//!
//! Ractor adapter for the [`dactor`] distributed actor framework (v0.2 API).
//!
//! This crate provides [`RactorRuntime`], which spawns dactor actors as real
//! ractor actors via [`ractor::Actor::spawn`]. Messages are delivered through
//! ractor's mailbox as type-erased dispatch envelopes, supporting multiple
//! `Handler<M>` impls per actor.
//!
//! # Quick start
//!
//! ```rust,no_run
//! use dactor::prelude::*;
//! use dactor::message::Message;
//! use dactor_ractor::RactorRuntime;
//! use async_trait::async_trait;
//!
//! struct MyActor;
//!
//! impl Actor for MyActor {
//! type Args = ();
//! type Deps = ();
//! fn create(_: (), _: ()) -> Self { MyActor }
//! }
//!
//! struct Greet(String);
//! impl Message for Greet { type Reply = (); }
//!
//! #[async_trait]
//! impl Handler<Greet> for MyActor {
//! async fn handle(&mut self, msg: Greet, _ctx: &mut ActorContext) {
//! println!("Got: {}", msg.0);
//! }
//! }
//!
//! #[tokio::main]
//! async fn main() {
//! let runtime = RactorRuntime::new();
//! let actor = runtime.spawn::<MyActor>("greeter", ()).await.unwrap();
//! actor.tell(Greet("hello".into())).unwrap();
//! }
//! ```
pub use RactorClusterEvents;
pub use ;
pub use ;
// Re-export the core dactor crate for convenience
pub use dactor;