olympus-robotics / hephaestus

Hephaestus is a C++ framework designed to facilitate robotics development by providing commonly needed functionality and abstractions.
MIT License
18 stars 2 forks source link

Subscriber: add option to run callback in a separate thread #115

Closed filippobrizzi closed 1 week ago

filippobrizzi commented 2 weeks ago

Description

Subscriber: add the option to run callback in a separate thread. When a message arrives, instead of being executed immediately it is pushed into a queue where a separate worker will fetch and execute it.

Add a new utility class QueueConsumer that waits on a queue for new data to be processed and when new data arrives call the user-provided callback on the data.