Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

subscribe-user and multiple browser tabs #249

Open
vporton opened this issue Nov 4, 2017 · 2 comments
Open

subscribe-user and multiple browser tabs #249

vporton opened this issue Nov 4, 2017 · 2 comments

Comments

@vporton
Copy link

vporton commented Nov 4, 2017

When I open two browser tabs which wait for subscribe-user messages for the same user in both tabs, only the first opened tab receives the messages.

Sadly, our source is closed and I cannot show example code. If needed I will work on extracting testing code out of our sources.

@2DKot
Copy link

2DKot commented Dec 26, 2017

Do you run project in development mode? You should use separate uWSGI instance and gevent to handle many clients.
http://django-websocket-redis.readthedocs.io/en/latest/running.html#django-with-websockets-for-redis-behind-nginx-using-uwsgi

@twodarek
Copy link

twodarek commented Dec 29, 2017

I am also experiencing this, but my cluster allows subscribe-user to occur once for a limit of TWO tabs per user. I use the example code for a user-side client, with the basic setup for a WSGI i jango.

@2DKot In my case, setting gevent in the launch config doesn't seem to help (copied below incase I didn't actually use it correctly)

In the launch script:

uwsgi --http :8001 --http-websockets --workers=2 --gevent 1000 --master --wsgi-file wsgi_websocket.py &

wsgi_websocket.py

import os
import gevent.socket
import redis.connection
redis.connection.socket = gevent.socket
os.environ.update(DJANGO_SETTINGS_MODULE='app.settings')
from ws4redis.uwsgi_runserver import uWSGIWebsocketServer
application = uWSGIWebsocketServer()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants