Commit fbf92f5b authored by marcel's avatar marcel

Fix pollsocket.

parent caeeb0da
......@@ -54,7 +54,7 @@ def remove_session(window_id, delay=False):
# remove from SUBSCRIBERS
if window_id in SUBSCRIBERS.keys():
del SUBSCRIBERS[window_id]
if delay:
POLLING_TIMESTAMPS[window_id] = int(time())
......@@ -76,11 +76,12 @@ def remove_session(window_id, delay=False):
del POLLING_TIMESTAMPS[window_id]
vispa.publish("bus.session_removed", window_id, user_id)
if last_lession:
logger.debug("no more user sessions %d" % int(user_id))
vispa.publish("bus.all_user_sessions_removed", int(user_id))
def get_polling_publisher(window_id, user_id):
POLLING_TIMESTAMPS[window_id] = int(time())
if window_id in SUBSCRIBERS.keys():
......@@ -248,6 +249,8 @@ class PollingPublisher:
self._waiting_thread_id = thread.get_ident()
result = [self._queue.get(timeout=timeout)]
while True:
if self._queue is None:
break
try:
r = self._queue.get(timeout=0)
result.append(r)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment