Expand description
Built-in demo chunks assembled with crate::ChunkBuilder.
Use these as runnable specs of the messaging contract (and as regression tests). Prefer copying a sample over inventing hop register layouts from scratch.
| Sample | Shows |
|---|---|
add_forty_two | Scalar VM path (no natives) |
ping_pong | Cap spawn + Atomic Hop round-trip |
atomic_request_reply | Tagged REQ/REP + print |
selective_receive | ReceiveMatch FIFO skip |
ask_reply | Ask RPC hop |
forged_sender_send / forged_sender_ask | S1: forged make_msg sender dies |
boom | Immediate trap (supervisor demos) |
Hop samples require crate::std_native_table.
Constants§
- TAG_
JUNK - Decoy hop for
selective_receiveÔÇö must be skipped byReceiveMatch. - TAG_
PING - TAG_
PONG - TAG_REP
- TAG_REQ
- Protocol tags for Atomic Hop samples.
Functions§
- add_
forty_ two r0 = 41 + 1; return r0ÔÇö the 60-second sanity chunk.- ask_
reply - Atomic request/reply via
Opcode::Ask(RPC hop). - atomic_
request_ reply - Atomic request-reply with
crate::Value::Message(one envelope per hop). - boom
- Immediate
TrapÔÇö used to showcrate::Supervisorrestart. - forged_
sender_ ask - Same security property as
forged_sender_send, viaOpcode::Ask. - forged_
sender_ send - Security regression sample: forged
make_msgsender must not surviveSend. - ping_
pong - Two flows, one Atomic Hop round-trip:
mainsends aMessagetopong,pongreplies with payload+1 viamsg_reply_cap,mainreturns that payload (2). - selective_
receive - Selective Atomic Hop: server waits for
TAG_REQwhile aTAG_JUNKhop sits ahead in the mailbox (FIFO skip, not drop).