But with increased resources, I can see some solutions being considered around snapshotting. For now the goal is heavily unix philosophy inspired: a really fast and purpose built event sourcing database
65 karma · joined October 2, 2024
Blog: tqwewe.com Git: git.tqwewe.com
But with increased resources, I can see some solutions being considered around snapshotting. For now the goal is heavily unix philosophy inspired: a really fast and purpose built event sourcing database
I think a community, open source built project in Rust has been a missing piece I can hopefully help to solve.
So gracefully shutting down an actor with `actor_ref.stop_gracefully().await` will process all pending messages before stopping. But the actor itself can be forcefully stopped with `actor_ref.kill()`
I wasn't aware async_trait wasn't needed, thats nice to see.
Also congrats on it being used in such a big company, thats awesome! I have a lot of respect for ractor and appreciate your response
Kameo does have a `spawn_in_thread` function for CPU bound actors if needed.
In kameo, all actors run in a `tokio::spawn` task.
Although Elixir is a nice language, I struggle to enjoy writing code in a language lacking types.
Ractor is nice, and I've used it in the past. A couple things differ between kameo and ractor:
- In ractor, messages must be defined in a single enum – in kameo, they can be separate structs each with their own `Message` implementation. This means messages can be implemented for multiple actors which can be quite useful.
- In ractor, the actor itself is not the state, meaning you must typically define two types per actor – in kameo, the actor itself is the state, which in my opinion simplifies things. As someone mentioned in a comment here, it was a bit of a turn off for me using ractor in the past and I didn't fully agree with this design decision
- Ractor requires the `#[async_trait]` macro – kameo does not.
There may be other obvious differences but I'm not super familiar with ractor besides these points
Its using libp2p under the hood with Kademlia distributed hash table for actor registrations.
actor.register('name') works by using a Kademlia DHT behind the scenes. This is implemented thanks to libp2p which handles all the complications of peer to peer connections
With Kameo, an actor running on another node is simply accessed through a RemoteActorRef, and you can message it the same way you would interact with a local actor. This flexibility allows you to avoid the overhead of schema management while still achieving seamless communication across nodes, making the system more dynamic and less rigid compared to gRPC.