|
79 | 79 | ---
|
80 | 80 | ``flask_uwsgi_websocket.WebSocket``
|
81 | 81 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
82 |
| -Automatically performs WebSocket handshake for you, but otherwise only exposes |
83 |
| -the `uWSGI WebSocket API |
| 82 | +``WebSocketMiddleware`` automatically performs WebSocket handshake and passes a ``WebSocketClient`` |
| 83 | +instance to your route. |
| 84 | + |
| 85 | + |
| 86 | +``flask_uwsgi_websocket.WebSocketMiddleware`` |
| 87 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 88 | +WebSocket Middleware used by ``WebSocket``. |
| 89 | + |
| 90 | + |
| 91 | +``flask_uwsgi_websocket.WebSocketClient`` |
| 92 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 93 | +Exposes the `uWSGI WebSocket API |
84 | 94 | <http://uwsgi-docs.readthedocs.org/en/latest/WebSockets.html#api>`_.
|
85 | 95 |
|
86 |
| -``websocket.recv()`` (alias ``websocket.receive()``) |
| 96 | +``WebSocket.recv()`` (alias ``WebSocket.receive()``) |
87 | 97 |
|
88 |
| -``websocket.recv_nb()`` |
| 98 | +``WebSocket.recv_nb()`` |
89 | 99 |
|
90 |
| -``websocket.send(msg)`` |
| 100 | +``WebSocket.send(msg)`` |
91 | 101 |
|
92 |
| -``websocket.send_binary(msg)`` |
| 102 | +``WebSocket.send_binary(msg)`` |
93 | 103 |
|
94 |
| -``websocket.recv_nb()`` |
| 104 | +``WebSocket.recv_nb()`` |
95 | 105 |
|
96 |
| -``websocket.send_from_sharedarea(id, pos)`` |
| 106 | +``WebSocket.send_from_sharedarea(id, pos)`` |
| 107 | + |
| 108 | +``WebSocket.send_binary_from_sharedarea(id, pos)`` |
97 | 109 |
|
98 |
| -``websocket.send_binary_from_sharedarea(id, pos)`` |
99 | 110 |
|
100 | 111 | ``flask_uwsgi_websocket.GeventWebSocket``
|
101 | 112 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
102 |
| -Fancier WebSocket abstraction that takes advantage of Gevent loop engine. Route |
103 |
| -handlers are spawned in their own greenlets and able to easily send messages to |
104 |
| -each other. |
| 113 | +Fancier WebSocket abstraction that takes advantage of Gevent loop engine. |
| 114 | +``GeventWebSocketMiddleware`` automatically performs WebSocket handshake and |
| 115 | +passes a ``GeventWebSocketClient`` instance to your route. Requires uWSGI to |
| 116 | +be run with ``--uwsgi`` option. |
| 117 | + |
| 118 | + |
| 119 | +``flask_uwsgi_websocket.GeventWebSocketMiddleware`` |
| 120 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 121 | +WebSocket Middleware used by ``GeventWebSocket``. |
| 122 | + |
| 123 | + |
| 124 | +``flask_uwsgi_websocket.GeventWebSocketClient`` |
| 125 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 126 | +WebSocket client abstraction with fully non-blocking methods. |
105 | 127 |
|
106 | 128 | ``websocket.receive()``
|
107 | 129 |
|
108 |
| -``websocket.send()`` |
| 130 | +``websocket.send(msg)`` |
109 | 131 |
|
110 | 132 | ``websocket.close()``
|
111 | 133 |
|
|
0 commit comments