Function rmw_publisher_wait_for_all_acked

Function Documentation

rmw_ret_t rmw_publisher_wait_for_all_acked(const rmw_publisher_t *publisher, rmw_time_t wait_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.

This function only works effectively while QOS profile of publisher is set to RELIABLE. Otherwise this function will immediately return RMW_RET_OK.

Attribute

Adherence

Allocates Memory

Maybe [1]

Thread-Safe

Yes

Uses Atomics

Maybe [1]

Lock-Free

Maybe [1]

[1] rmw implementation defined, check the implementation documentation

Runtime behavior

Waiting for all acknowledgments is synchronous operation. So the calling thread is blocked until all published message data is acknowledged or specified duration elapses.

Thread-Safety

Publishers are thread-safe objects, and so are all operations on them except for finalization. Therefore, it is safe to call this function using the same publisher concurrently.

Parameters:
  • publisher[in] handle to the publisher that needs to wait for all acked.

  • wait_timeout[in] represents the maximum amount of time to wait for all published message data were acknowledged.

Pre:

Given publisher must be a valid publisher, as returned by rmw_create_publisher().

Returns:

RMW_RET_OK if successful, or

Returns:

RMW_RET_TIMEOUT if wait timed out, or

Returns:

RMW_RET_INVALID_ARGUMENT if publisher is NULL, or

Returns:

RMW_RET_INCORRECT_RMW_IMPLEMENTATION if the publisher implementation identifier does not match this implementation, or

Returns:

RMW_RET_ERROR if an unspecified error occurs, or

Returns:

RMW_RET_UNSUPPORTED if the rmw implementation is unimplemented.