Skip to main content

pamoja_event_bus_publish

Function pamoja_event_bus_publish 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_event_bus_publish( bus: *const PamojaEventBus, payload: *const u8, payload_len: usize, ) -> PamojaStatus
Expand description

Publishes an event to every subscriber, this endpoint included.

The call never waits: a subscriber that has fallen behind loses its oldest event rather than holding up the publisher.

§Arguments

  • bus - the endpoint to publish from.
  • payload - the event bytes.
  • payload_len - the length of payload.

§Returns

PamojaStatus::Ok once every subscriber has been handed the event.

§Safety

bus must be a live handle, and payload must point to at least payload_len readable bytes or be null when that length is 0.