@@ -72,11 +72,15 @@ automatically for you.
72
72
73
73
API
74
74
---
75
- Flask-uWSGI-Websocket automatically performs the WebSocket handshake for you
76
- and passes your route handler a websocket client exposing `uWSGI's WebSocket API
75
+ ``flask_uwsgi_websocket.WebSocket ``
76
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
77
+ Automatically performs WebSocket handshake for you, but otherwise only exposes
78
+ the `uWSGI WebSocket API
77
79
<http://uwsgi-docs.readthedocs.org/en/latest/WebSockets.html#api> `_.
78
80
79
- ``websocket.recv() ``
81
+ ``websocket.recv() `` (alias ``websocket.recveive() ``)
82
+
83
+ ``websocket.recv_nb() ``
80
84
81
85
``websocket.send(msg) ``
82
86
@@ -88,9 +92,16 @@ and passes your route handler a websocket client exposing `uWSGI's WebSocket API
88
92
89
93
``websocket.send_binary_from_sharedarea(id, pos) ``
90
94
91
- In addition there is a special ``websocket.receive() `` method which tries to
92
- make non-blocking calls simpler. When using the ``WebSocket `` plugin, it blocks
93
- making it appropriate for threaded or multiprocess concurrency models. When
94
- using ``GeventWebSocket `` it'll take advantage of gevent and make a
95
- non-blocking recv call. ``AsyncWebsocket `` should do roughly the same thing,
96
- but currently plain ``--async `` concurrency model is a bit buggy in uWSGI 2.0.
95
+ ``flask_uwsgi_websocket.GeventWebSocket ``
96
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
97
+ Fancier WebSocket abstraction that takes advantage of Gevent loop engine. Route
98
+ handlers are spawned in their own greenlets and able to easily send messages to
99
+ each othek.
100
+
101
+ ``websocket.recveive() ``
102
+
103
+ ``websocket.send() ``
104
+
105
+ ``websocket.close() ``
106
+
107
+ ``websocket.connected ``
0 commit comments