How can one call a boost signals2 slot on a separate thread without blocking the thread that is emitting the signal? I would like to get the functionality of the Qt5 QObject::connect
with the QueuedConnection argument; for Qt5 details see Threads and QObjects. That is, I need to be able to emit a boost signals2 signal with no possiblity of blocking the thread that is emitting the signal; the slots that are connected are called from a separate "event" thread.
I like the functionality of the Qt5 API, but I cannot have QObject as a base class and the additional MOC machinery in my API and implementation. Boost signals2 is thread safe in its connection handling, but it is not multithreaded (really I am just looking for non-blocking) in its calls to connected slots.
I believe a combination of boost signals2 and asio as an event loop could do what I need, but I am unsure how to implement this. Plus, I am sure other people have had similar needs, so I am looking for ideas and suggestions on how to achieve this.
Thanks!