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
I modified the example application to add rabbitmq support with:
socketio = SocketIO(app, async_mode=None, message_queue='amqp://')
It worked fine when I send simple messages and mess around with rooms. When I try to use disconnect, the server recieved the disconnect request then do emit a "Disconnected!" message and disconnect. However, the client coud not recieve the message and the connection got closed.
Then I tried redis message queue with:
socketio = SocketIO(app, async_mode=None, message_queue='redis://')
This time the client showed the "Disconnected!" message.
Any idea why rabbitmq doesn't work?
The text was updated successfully, but these errors were encountered:
I wonder if it is just a timing thing. Maybe rabbitmq is a slightly bit slower in delivering the message, and the disconnect happens first. Try adding a socketio.sleep(1) in between the emit and the disconnect calls to see if that makes it work. If that does it, then I think it is timing. Emitting and immediately disconnecting isn't really a great idea anyway, normally if you want to make sure the message is delivered before disconnecting you would use a callback, and then disconnect in the callback. I should probably update the example to do it that way, come to think of it.
I modified the example application to add rabbitmq support with:
socketio = SocketIO(app, async_mode=None, message_queue='amqp://')
It worked fine when I send simple messages and mess around with rooms. When I try to use disconnect, the server recieved the disconnect request then do emit a "Disconnected!" message and disconnect. However, the client coud not recieve the message and the connection got closed.
Then I tried redis message queue with:
socketio = SocketIO(app, async_mode=None, message_queue='redis://')
This time the client showed the "Disconnected!" message.
Any idea why rabbitmq doesn't work?
The text was updated successfully, but these errors were encountered: