Function rcl_publisher_wait_for_all_acked
Defined in File publisher.h
Function Documentation
-
rcl_ret_t rcl_publisher_wait_for_all_acked(const rcl_publisher_t *publisher, rcl_duration_value_t timeout)
Wait until all published message data is acknowledged or until the specified timeout elapses.
This function waits until all published message data were acknowledged by peer node or timeout.
The timeout unit is nanoseconds. If the timeout is negative then this function will block indefinitely until all published message data were acknowledged. If the timeout is 0 then this function will be non-blocking; checking all published message data were acknowledged (If acknowledged, return RCL_RET_OK. Otherwise, return RCL_RET_TIMEOUT), but not waiting. If the timeout is greater than 0 then this function will return after that period of time has elapsed (return RCL_RET_TIMEOUT) or all published message data were acknowledged (return RCL_RET_OK).
This function only waits for acknowledgments if the publisher’s QOS profile is RELIABLE. Otherwise this function will immediately return RCL_RET_OK.
Attribute
Adherence
Allocates Memory
No
Thread-Safe
Yes
Uses Atomics
No
Lock-Free
No
- Parameters:
publisher – [in] handle to the publisher that needs to wait for all acked.
timeout – [in] the duration to wait for all published message data were acknowledged, in nanoseconds.
- Returns:
RCL_RET_OK if successful, or
- Returns:
RCL_RET_TIMEOUT if timed out, or
- Returns:
RCL_RET_PUBLISHER_INVALID if publisher is invalid, or
- Returns:
RCL_RET_ERROR if an unspecified error occurs, or
- Returns:
RCL_RET_UNSUPPORTED if the middleware does not support that feature.