Skip to main content

Module sync

Module sync 

Source
Expand description

The C ABI for store-and-forward buffers.

These functions wrap [pamoja_sync] for callers that reach the SDK through the flat C boundary: the queue a node writes into while it has nowhere to send, and the drain that empties it once a link comes back.

Two stores cross, behind one handle. An in-memory queue is the right choice for a test or a process that will not outlive its buffer; a file-backed one survives a reboot, which is what a node in a place with no reliable power actually needs. The kind is chosen when the store is created and nothing afterwards has to care which it is.

Structs§

PamojaStore
An opaque handle to a store-and-forward buffer.

Functions§

pamoja_store_append⚠
Adds a record to the end of a buffer.
pamoja_store_drain_to⚠
Sends every held record over a transport, oldest first.
pamoja_store_file⚠
Opens a buffer backed by a directory, so it survives a restart.
pamoja_store_free⚠
Releases a store handle.
pamoja_store_len⚠
Reports how many records a buffer holds.
pamoja_store_memory
Creates a buffer held in memory.
pamoja_store_peek⚠
Reads the oldest record without removing it.
pamoja_store_pop⚠
Removes and returns the oldest record.