Skip to content
Start free evaluation

pdcomm_secs1_next_event

Function

Takes the oldest queued event.

PdcommStatus pdcomm_secs1_next_event(PdcommSecs1Endpoint *endpoint, PdcommSecs1Event **out)

Declared in: #include <pdcomm_secs1.h>

An empty queue returns #PDCOMM_OK with *out NULL. When the event object cannot be allocated, the exact event is staged and returned by the next call; until then pdcomm_secs1_start(), pdcomm_secs1_poll(), pdcomm_secs1_submit(), pdcomm_secs1_reset(), and pdcomm_secs1_stop() return #PDCOMM_BACKPRESSURE.

Parameters

NameDescription
endpointEndpoint that is created or started (not stopped).
outReceives the event or NULL. Set to NULL first.

Returns

#PDCOMM_OK on success, including an empty queue; #PDCOMM_INVALID_ARGUMENT when out or endpoint is NULL; #PDCOMM_ALLOCATION_FAILED when the event could not be allocated (it stays staged for retry); #PDCOMM_INVALID_STATE when the endpoint is stopped, or on a wrong-thread, concurrent, or reentrant call; #PDCOMM_POISONED when the endpoint is poisoned.

Notes

  • Ownership: release each event with pdcomm_secs1_event_destroy(). Events are owned snapshots and remain valid after the endpoint is destroyed.
  • Thread safety: call only on the creating thread.