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.

§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, or PamojaStatus::Closed if the bus has shut down.

§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.