Open jm130794 opened 5 years ago
Hi!
Do you want to use the same event-loop for amqp-cpp and RESTinio?
Hi Jean-Marc,
I've taken a look on amqp-cpp, and I'm pretty sure restinio and amqp-cpp can coexist in a single application. Even though boost-asio is not manifested as officially supported you have the following options:
PS Depending on how complicated your internal logic is (seems like you want to be very async) it might worth an effort to look at Actor model and apply it to your case. For example, we've used our own amqp-client (back in 2014) with SObjectizer (a library implementing actor model in C++) in production, so I can say that amqp+sobjectizer works nicely.
I have never used SObjectizer but indeed, your slides are very interesting. I'm going to test this library.
I don't expect any serious problem if:
May be if you tell some more details about your task and desired application design we could make more useful advices.
Hi, I started studying SObjectizer. It seems to me that I have a good understanding of how agents and associated mboxes work. I have made one or two programs and everything is working well.
I have a question: if I integrate AMQP-CPP into an agent (maybe I'm wrong), will the agent be able to handle the events to which it has subscribed? Isn't the ev_loop loop blocking?
Jean-Marc
if I integrate AMQP-CPP into an agent (maybe I'm wrong), will the agent be able to handle the events to which it has subscribed? Isn't the ev_loop loop blocking?
If I understand you correctly you want to run AMQP-CPP (with underlying ev_loop) in so_evt_start() of some agent. Right?
In that case, I think, ev_loop will block the work thread of that agent and agent can't handle messages. Maybe it is possible to write a special dispatcher that will use ev_loop from AMQP-CPP to dispatch events for agents bound to that dispatcher (like we do in so_5_extra for Aiso: asio_thread_pool). But it is a complex task.
If you can spawn several wok threads in your app then, I think, the easiest way can be:
There are no problems with RESTinio -- it's an asynchronous framework that allows delegating of actual request processing to separate worker thread. Unfortunately, I don't know does AMQP-CPP allow this.
Hello, I am asked if it is possible to use amqp-cpp with restinio. As I don't know, I ask the question to the developers of restinio:)
Do you think this is possible easily enough?
Jean-Marc