caeryn 0.1.0

Small protected runtime core with isolated execution contexts
Documentation
  • Coverage
  • 100%
    40 out of 40 items documented2 out of 27 items with examples
  • Size
  • Source code size: 13.62 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 683.08 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2s Average build duration of successful builds.
  • all releases: 14s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Tknott95

caeryn

Small protected runtime core with isolated execution contexts.

Purpose

caeryn (from Welsh caer, a fortified enclosure) provides a minimal runtime for managing isolated execution contexts. Each context has its own state, counters, output, and guard status — like rooms in a fortress.

Features

  • Isolated contexts — each context has independent state and counters
  • Task queue — submit tasks and run them in batch
  • Guard system — pause or stop individual contexts
  • Event log — track spawns and lifecycle events
  • Zero dependencies

Install

cargo add caeryn

Usage

use caeryn::{Runtime, Task};

let mut rt = Runtime::new();
let ctx = rt.spawn("worker");

rt.submit(ctx, Task::SetState("role".into(), "builder".into())).unwrap();
rt.submit(ctx, Task::Increment("tasks_done".into())).unwrap();
rt.submit(ctx, Task::Echo("job finished".into())).unwrap();
rt.run_all();

let c = rt.context(ctx).unwrap();
assert_eq!(c.state("role"), Some("builder"));
assert_eq!(c.counter("tasks_done"), 1);

License

MIT OR Apache-2.0