TibrvDispatchable::timedDispatch()

Method

Declaration

virtual TibrvStatus timedDispatch(tibrv_f64 timeout) = 0;

Purpose

Dispatch an event, but if no event is ready to dispatch, limit the time that this call blocks while waiting for an event.

Remarks

If an event is ready to dispatch, then this call dispatches it, and then returns. If no events are waiting, this call waits for an event to arrive. If an event arrives before the waiting time elapses, then it dispatches the event and returns. If the waiting time elapses first, then the call returns without dispatching an event.

When the call dispatches an event, it returns the status code TIBRV_OK. When the call does not dispatch an event, it returns the status code TIBRV_TIMEOUT.

Both TibrvQueue and TibrvQueueGroup implement this method.

Parameter

Description

timeout

Maximum time (in seconds) that this call can block while waiting for an event to arrive.

TIBRV_NO_WAIT (zero) indicates no blocking (immediate timeout).

TIBRV_WAIT_FOREVER (-1) indicates no timeout.

See Also

TibrvDispatchable

TibrvQueue::timedDispatch()

TibrvQueueGroup::timedDispatch()