title: Flask-SocketIO through Gunicorn and REDIS as a message queue
body: <p>Heyo,</p>
  
  <p>I am trying to create websocket server using flask-socketio but I ran into a problem, the sockets drop! I am running gunicorn with 4 workers and I am aware of the fact that socketio library is storing the data in-memory(that is why I have redis installed because I have encountered similar issue before), I have pointed an app to the redis server but it still doesn't work with 4 workers, however running gunicorn with 1 worker is okay.</p>
  
  <p>Here is my application init code:</p>
  
  <pre><code>from flask import Flask
  from flask_json import FlaskJSON, JsonError, json_response, as_json
  from webroutes import shallow
  from userapi import user_api
  from app_service import shallow_service
  import os
  from flask_socketio import SocketIO
  from reddissession import RedisSessionInterface
  from socket_worker import Messenger
  import eventlet
  eventlet.monkey_patch()
  # from gevent.wsgi import WSGIServer
  
  application = Flask(__name__)
  application.secret_key = os.urandom(64)
  FlaskJSON(application)
  socketio = SocketIO()
  socketio.on_namespace(Messenger("/messenger_socket"));
  application.register_blueprint(shallow)
  application.register_blueprint(user_api)
  application.register_blueprint(shallow_service)
  application.config['TEMPLATES_AUTO_RELOAD'] = True
  
  
  application.session_interface = RedisSessionInterface()
  socketio.init_app(application, message_queue='redis://')
  </code></pre>
  
  <p>Here is what I get in console.log:</p>
  
  <p><a href="https://i.stack.imgur.com/lKGgH.png" rel="nofollow noreferrer">Output</a></p>
  
  <p>Please send help, thanks</p>