The documentation of the rcl_XYZ_set_on_new_XYZ_callback does not state the calling thread context,
and the need to not do blocking operations in the callbacks.
Here is an example of the documentaiton from the rclcpp layer for the subscription case:
/// Set a callback to be called when each new message is received.
/**
* The callback receives a size_t which is the number of messages received
* since the last time this callback was called.
* Normally this is 1, but can be > 1 if messages were received before any
* callback was set.
*
* Since this callback is called from the middleware, you should aim to make
* it fast and not blocking.
* If you need to do a lot of work or wait for some other event, you should
* spin it off to another thread, otherwise you risk blocking the middleware.
*
* Calling it again will clear any previously set callback.
*
* This function is thread-safe.
*
* If you want more information available in the callback, like the subscription
* or other information, you may use a lambda with captures or std::bind.
*
* \sa rmw_subscription_set_on_new_message_callback
* \sa rcl_subscription_set_on_new_message_callback
*
* \param[in] callback functor to be called when a new message is received
*/
The task would be to update the rcl and rmw documenation for the functions.
Relates #1277
The documentation of the rcl_XYZ_set_on_new_XYZ_callback does not state the calling thread context,
and the need to not do blocking operations in the callbacks.
Here is an example of the documentaiton from the rclcpp layer for the subscription case:
The task would be to update the rcl and rmw documenation for the functions.
Relates #1277