IGL4QVNKJN6CBABXN3DMDT62S6SQ4NX3CK7VHRSD47IUN5V6YJYAC
0{"type":"Message","from":null,"to":"35c87090-2182-4d5a-9a64-6cd105722066","payload":{"id":"35c87090-2182-4d5a-9a64-6cd105722066"}}
{"type":"Message","from":null,"to":"35c87090-2182-4d5a-9a64-6cd105722066","payload":{"id":"35c87090-2182-4d5a-9a64-6cd105722066"}}
{"type":"Message","from":"35c87090-2182-4d5a-9a64-6cd105722066","to":"35c87090-2182-4d5a-9a64-6cd105722066","payload":{"status":"ok","count":1}}
let message: Message = serde_json::from_str(&line).expect("Failed to parse message");
// Handle incoming data message
log("info", &format!("Received message({count}): {message:?}"));
match serde_json::from_str(&line).expect("Failed to parse message") {
Message::Spawned { id, props } => match id {
Ok(id) => log("info", &format!("Spawned actor {id}")),
Err(e) => log("error", &format!("Failed to spawn actor ({props:?}): {e}")),
},
Message::Data(Data { from, to, payload }) => {
// Handle incoming data message
log(
"info",
&format!(
"Received message({count}): {:?}",
Data { from, to, payload }
),
);
if count == 5 {
send_message(&Props {
executable: std::path::PathBuf::from("/usr/bin/cat"),
args: vec![s!("-h")],
});
}
# Unified Actor Framework
This is an experiment to use unix processes as actors.
## Getting Started
1) Get sources
1) With pijul
```bash
pijul clone https://nest.pijul.com/hardliner66/uaf
```
2) With git
```bash
git clone https://github.com/hardliner66/uaf
```
2) Build the framework and the test actor
```bash
cargo build --release --all
```
3) Run the test actor
```bash
./target/release/uaf ./target/release/test-actor
```