Browse Source

fix: respect write_only

pull/493/head
johaven 5 years ago
parent
commit
7151059e3b
  1. 3
      socketio/uwsgi_manager.py

3
socketio/uwsgi_manager.py

@ -24,7 +24,6 @@ class UWSGIManager(PubSubManager): # pragma: no cover
server = socketio.Server(client_manager=socketio.UWSGIManager())
Notes:
- uWSGI signal must be registered when app is starting.
- ``uwsgi.signal_wait()`` not working in async mode but
when fixed it will be a better approach for the listen part.
- uWSGI does not provide a blocking queue, the workaround is to use the
@ -45,7 +44,6 @@ class UWSGIManager(PubSubManager): # pragma: no cover
self._check_configuration()
self.signum = self._sig_number(url)
self.queue = Queue()
uwsgi.register_signal(self.signum, 'workers', self._enqueue)
super(UWSGIManager, self).__init__(channel=channel,
write_only=write_only,
logger=logger)
@ -80,6 +78,7 @@ class UWSGIManager(PubSubManager): # pragma: no cover
self.queue.put(uwsgi.queue_last())
def _uwsgi_listen(self):
uwsgi.register_signal(self.signum, 'workers', self._enqueue)
for message in iter(self.queue.get, None):
if message is not None:
yield message

Loading…
Cancel
Save