Fairjax
A Rust crate for efficiently performing fair join pattern matching i.e. the process of matching several received messages in a mailbox against one of more patterns. If we can find a combination of messages that matches a pattern and satisfies the guard, the messages are consumed and the body of the match arm is executed.
Fair and Deterministic Matching
fairjax implements join pattern matching in a fair and deterministic manner,
ensuring that we always match the oldest messages possible. Furthermore this ensures completely
deterministic and reproducible behavior.
Example
// Define message types
use *;
// Declare state-keeping mailbox
let mut mailbox = default;
// Simulate input messages
let messages = vec!;
let mut matches = vec!;
// Recieve message one by one
for msg in messages
assert_eq!;