▲ | SJC_Hacker 2 days ago | |
Out of curiousity what was the issue with just wrapping the AMQP-CPP pub/sub calls around a mutex? | ||
▲ | HarHarVeryFunny 11 hours ago | parent [-] | |
I'm a bit hazy on the full details because it was a few years ago, but basically it gets more complicated because you subscribe by installing an async callback which needs to ack/nak messages, needing locking, and will be called from the context of the network event loop that also needs locking. If you do any real work in the message processing callback then you'll be blocking the event loop, so the callback has to defer processing by queuing C++ lambdas capturing the context, and running those in a thread pool. |