Arrows
An actor framework in rust with message durability and ingestion order processing of messages. Message persistence via an embedded sqlite instance. Message content can be text or binary. Messages themselves get stored as binany in the backing store.
use crate::;
use ;
//A sample actor
;
//Producer implementations are called to produce actor instances.
//Produces DemoActor instances
;
//Producer implementations need to be tagged with `typetag` marker.
//The `define_actor` - macro actually defines a new actor `instance` in the system. The
//actor instance along with the producer - get persisted in the backing store, the actor
//instance gets activated and receives a startup signal and becomes ready to process
//incoming messages. The producer defintion is used to restart/restore the actor as
//required.
use define_actor;
let producer = default;
define_actor!;
//At this stage - the actor instance `demo_actor` is ready for incoming messages. It
//should have already received the startup signal.
use send;
let m1 = from_text;
let m2 = from_text;
let m3 = from_text;
send!;
//Create another actor instance - demo_actor1
define_actor!;
let m4 = from_text;
let m5 = from_text;
let m6 = from_text;
let m7 = from_text;
//Send out multiple messages to multiple actors at one go
send!;
//Actors running in remote systems - need to be identified by the `Addr` construct:
use Addr;
let remote_actor = remote;
let m1 = with_text;
let m2 = with_text;
send!;
//While sending to a single actor - its not recessary to group messages within braces.
How to get started:
- Clone the github repository.
- Do a cargo build in the project directory.
- Launch an extra terminal
- Fire the
register.sh
script in the project directory. - In another terminal launch the
server.sh
script in the same directory - From previous termainal launch the
send.sh
script - actors should start receiving messages
Contribution:
This project is still evolving. Contributions are welcome.