skip to content
==> README.md <==
1# @ajax/mesh-rt-sim-mailbox
2
3A mailbox in host memory with one mesh program slot, and the host side of the contract for it, for tests
4on @ajax/mesh-rt-sim: the header of a single system, the program table entry (under its seqlock), the
5extension (param, scratch), publishing tickets and waiting for their marks (as meshd's publisher), the
6request window, the input queue, and a halt that rewinds the ring for a relaunch.
7
8```c
9uint8_t *mb = mesh_sim_mailbox();
10mesh_sim_prog p = {.name = "hello", .view_bytes = 0x1000, .nodes = 2};
11uint8_t *view = mesh_sim_install(mb, 3, &p);
12mesh_sim_launch *l = mesh_sim_launch_prog(mb, 3, &p, mesh_main);
13uint32_t r = mesh_sim_call(mb, 3, MESH_OP_TASK, 5);
14mesh_sim_halt(mb, 3, l);
15```
16
17- **Ported from:** the publisher rules of alpha-rust-mesh `crates/mesh-host/src/publish.rs` (ticket t uses
18  ring entry and completion slot t % 64; no ticket 64 or more ahead of the oldest outstanding one) and the
19  halt rewind (`PRing::rewind`). Not a meshd: no policies, blinks or snapshots.
20- **Tests:** every program's simulator test uses it.