Skip to main content

pamoja_store_drain_to

Function pamoja_store_drain_to 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_store_drain_to( store: *mut PamojaStore, transport: *mut PamojaTransport, topic: *const c_char, out_sent: *mut usize, ) -> PamojaStatus
Expand description

Sends every held record over a transport, oldest first.

A record is removed only once the transport has taken it, so a link that fails part-way leaves the rest of the queue intact for the next attempt.

§Arguments

  • store - the buffer to drain.
  • transport - the transport to send over, borrowed rather than consumed.
  • topic - the topic to send to, as null-terminated UTF-8.
  • out_sent - receives how many records went out, or may be null.

§Returns

PamojaStatus::Ok if the whole buffer drained, or a transport error with out_sent holding how many got through before it stopped.

§Safety

store and transport must be live handles, topic a valid null-terminated UTF-8 string, and out_sent writable or null.