Skip to main content

Module samples

Module samples 

Source
Expand description

Built-in demo chunks assembled with crate::ChunkBuilder.

These are the runtime’s “hello world” suite: scalar arithmetic, an Atomic Hop ping-pong, request-reply, selective receive (ReceiveMatch), and a deliberate Trap for supervisor demos.

Constants§

TAG_JUNK
Decoy hop for selective_receive — must be skipped by ReceiveMatch.
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 show crate::Supervisor restart.
forged_sender_ask
Same security property as forged_sender_send, via Opcode::Ask.
forged_sender_send
Security regression sample: forged make_msg sender must not survive Send.
ping_pong
Two flows, one Atomic Hop round-trip: main sends a Message to pong, pong replies with payload+1 via msg_reply_cap, main returns that payload (2).
selective_receive
Selective Atomic Hop: server waits for TAG_REQ while a TAG_JUNK hop sits ahead in the mailbox (FIFO skip, not drop).