I'm fairly new to ROS2 after having worked with ROS for a number of years. A typical pattern we would often use was to have a ROS node subscribe to a number of inputs, and then combine and process them into a single output. Depending on the application, the node might be required not to produce output at a fixed rate, but rather matching one of the input streams (let's call it the primary input) with the newest or interpolated data from each of the other streams (herafter refered to as the auxilary inputs). In order to keep the callbacks light, we would implement this where each auxilary input would simply save the latest msg, or add it to an interpolator, and the primary input callback would then pack each of it's inputs with the newest value for each of the auxilary inputs and add this to a processig queue. The node would then have a main loop consuming the data in the processing queue. We would implement this using the AsyncSpinner for the callbacks and have the consumer run in a while loop in the main thread.
In ROS2, I really like how the Timer class now has a callback so that your fixed rate loops can be run in a homogenous mannor with your callbacks, however this doesn't fit the usecase described above, as the main loop should run full-rate only waiting when the queue is empty. I can of course just start a thread manually, but this breaks the neat homogenous execution control, leaving the node threading to be handled directly for that specific thread.
Is there a mechanism in ROS2 for such a pattern, and otherwise, do people think this might be a good suggestion for an addition, as a construct along side pub/sub, service, action, and timer callbacks?