holoscan::channel_internal::wait_and_receive_next
holoscan::channel_internal::wait_and_receive_next
Receive one sample from subscriber, waiting for readiness until deadline.
The first attempt runs before any wait context exists, so an already queued sample is returned without building a wait set and without a kernel wait. ErrorCode::kNotReady is absorbed from both the attempt and the wait, because readiness is only a hint: an attempt that loses its race against a lossy replacement, a private control operation, or a competing consumer waits again against the same absolute deadline. Every other error is returned unchanged from the first attempt that produces it, so a terminal ErrorCode::kClosed or an active-loan ErrorCode::kFailure is reported before any wait is built.
This function never returns ErrorCode::kNotReady. A subscriber that keeps reporting readiness while every attempt loses its race retries at full speed until deadline, which is checked after every readiness query on both its outcomes; that absolute deadline is the only bound, which is why no duration overload exists.
Returns: The receive result, or the first error that is not ErrorCode::kNotReady.
Template parameters
Callable taking no arguments and returning this endpoint family’s expected receive result.
Parameters
Endpoint whose readiness is awaited; it must outlive this call.
Steady-clock coordinate after which the wait reports a timeout.
Optional borrowed cancellation observer; null disables cancellation.
One repeatable receive attempt, invoked at least once.