Skip to main content

pamoja_event_bus_next_within

Function pamoja_event_bus_next_within 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_event_bus_next_within( bus: *const PamojaEventBus, timeout_ms: u64, out_event: *mut *mut PamojaBuffer, out_timed_out: *mut bool, ) -> PamojaStatus
Expand description

Waits for the next event on this endpoint, giving up after a time limit.

A wait that runs out takes no event, so the next one published is left for the next call.

§Arguments

  • bus - the endpoint to receive on.
  • timeout_ms - how long to wait, in milliseconds, including any wait for another call on this endpoint to finish. A limit too far off to schedule waits as pamoja_event_bus_next does.
  • out_event - receives a buffer handle the caller must release with pamoja_buffer_free, or null when the time ran out.
  • out_timed_out - receives true when the time ran out.

§Returns

PamojaStatus::Ok whether an event arrived or the time ran out.

§Safety

bus must be a live handle, and out_event and out_timed_out must be writable.