Skip to main content

Module ladder

Module ladder 

Source
Expand description

The C ABI for the cost-aware transport ladder.

These functions wrap [pamoja_ladder] for callers that reach the SDK through the flat C boundary. A ladder is the answer to a node that has more than one way to reach the network and no single one that always works: rungs are tried in the order they were added, cheapest first, and a message no rung accepts goes into a buffer rather than being lost.

The Rust ladder is generic over its buffer, which cannot cross a C ABI, so this one is built over the store handle from crate::sync. That handle already covers both an in-memory and a file-backed queue, so nothing is given up: a caller still chooses whether the buffer survives a restart.

Structs§

PamojaLadder
An opaque handle to a ladder and the buffer behind it.

Enums§

PamojaDelivery
What became of a message handed to a ladder.

Functions§

pamoja_ladder_buffered
Reports how many messages are waiting in the buffer.
pamoja_ladder_connect
Connects every rung, so a send can be tried against each in turn.
pamoja_ladder_flush
Replays the buffer over the rungs, oldest message first.
pamoja_ladder_free
Releases a ladder handle, and the rungs and buffer it owns.
pamoja_ladder_new
Creates a ladder with no rungs, buffering into a store.
pamoja_ladder_rung
Adds a rung, which is tried after the rungs already added.
pamoja_ladder_send
Sends a payload, falling through the rungs and buffering if none take it.