You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! I'm refactoring the client for RabbitMQ, moving it from amphp v2 to amphp v3, and am a bit confused about when not to use the async function. For example, we have a connection to rabbit over amphp/socket.
Its main task is to write frames to the socket and expect them from there. Once a complete frame has been collected, we find the Future waiting for that frame and complete it.
Here's an example of how Future is created that subscribes to frames:
So the question is: should we wrap these two actions in the async function, given that the Connection::method method uses amphp/socket and our future method is also non-blocking or does that not make sense?
In other words, is it necessary to write code in this way?
Hello! I'm refactoring the client for RabbitMQ, moving it from amphp v2 to amphp v3, and am a bit confused about when not to use the
async
function. For example, we have a connection to rabbit overamphp/socket
.Its main task is to write frames to the socket and expect them from there. Once a complete frame has been collected, we find the
Future
waiting for that frame and complete it.Here's an example of how
Future
is created that subscribes to frames:When we declare a queue, we write a special frame to the socket and expect a special frame from it.
So the question is: should we wrap these two actions in the
async
function, given that theConnection::method
method uses amphp/socket and ourfuture
method is also non-blocking or does that not make sense?In other words, is it necessary to write code in this way?
The text was updated successfully, but these errors were encountered: