Skip to content

AsyncAioPikaManager connecting to RabbitMQ #1167

Answered by RaphaelHippe
RaphaelHippe asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,
wanted to come back to this and report that with the help of a friend finally got a working solution:

server.py

import socketio
import eventlet
import logging
import sys
import os

eventlet.monkey_patch()

# create a SocketIO server instance
sio = socketio.Server(
    client_manager=socketio.RedisManager(url="redis://127.0.0.1:6379/0")
)


# define the event handler for the "message" event
@sio.on("message")
def handle_message(sid, data):
    logging.info("Message received: {}".format(data))
    # send a reply back to the client
    sio.emit("reply", "Thanks for your message!", room=sid)


# create a WSGI application that combines the SocketIO server with a Flask app
app = socketio.WS…

Replies: 2 comments 10 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
10 replies
@miguelgrinberg
Comment options

@RaphaelHippe
Comment options

@miguelgrinberg
Comment options

@RaphaelHippe
Comment options

Answer selected by RaphaelHippe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants