File tree Expand file tree Collapse file tree 3 files changed +16
-11
lines changed Expand file tree Collapse file tree 3 files changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -138,9 +138,13 @@ Automatically performs WebSocket handshake and passes a ``GeventWebSocketClient`
138138^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
139139WebSocket client abstraction with fully non-blocking methods.
140140
141+ receive() and receive_nowait() differs in that receive_nowait()
142+ will raise a ``gevent.queue.Empty `` exception immediately
143+ if there is no message available.
144+
141145``receive() ``
142146
143- ``receive_nb () ``
147+ ``receive_nowait () ``
144148
145149``send(msg) ``
146150
Original file line number Diff line number Diff line change @@ -29,20 +29,21 @@ def send(self, message):
2929 self .send_event .set ()
3030
3131 def receive (self ):
32- """ Receives a message from the websocket (blocking).
32+ """ Receives a message from the websocket.
33+ Although the underlying bytes are received via non blocking i/o,
34+ this method will block if there are no waiting messages.
3335 :return the message
3436 """
3537 return self .recv_queue .get ()
3638
37- def receive_nb (self ):
38- """ Receives a message from the websocket (non-blocking).
39- :return the message or None if no message was available
40- immediately
39+ def receive_nowait (self ):
40+ """ Receives a message from the websocket.
41+ This differs from the receive() method in that, if there are
42+ no waiting messages, this method will quickly return.
43+ :return the messag
44+ :raise gevent.queue.Empty if no message was immediately available
4145 """
42- try :
43- return self .recv_queue .get_nowait ()
44- except Empty :
45- return None
46+ return self .recv_queue .get_nowait ()
4647
4748 def close (self ):
4849 self .connected = False
Original file line number Diff line number Diff line change 33
44setup (
55 name = 'Flask-uWSGI-WebSocket' ,
6- version = '0.2.5.2 ' ,
6+ version = '0.2.5.3 ' ,
77 url = 'https://github.com/zeekay/flask-uwsgi-websocket' ,
88 license = 'MIT' ,
99 author = 'Zach Kelling' ,
You can’t perform that action at this time.
0 commit comments