Skip to content

Commit

Permalink
Fixed poll() method to always empty the queue
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed Nov 20, 2017
1 parent 212bede commit e8e665b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions engineio/socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ def poll(self):
raise exceptions.QueueEmpty()
if packets == [None]:
return []
try:
packets.append(self.queue.get(block=False))
self.queue.task_done()
except self.server._async['queue'].Empty:
pass
while True:
try:
packets.append(self.queue.get(block=False))
self.queue.task_done()
except self.server._async['queue'].Empty:
break
return packets

def receive(self, pkt):
Expand Down

0 comments on commit e8e665b

Please sign in to comment.