Skip to content

Commit 522afaa

Browse files
author
zeekay
committed
Update README.
1 parent d419c73 commit 522afaa

File tree

1 file changed

+24
-18
lines changed

1 file changed

+24
-18
lines changed

README.rst

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -79,56 +79,62 @@ API
7979
---
8080
``flask_uwsgi_websocket.WebSocket``
8181
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
82-
``WebSocketMiddleware`` automatically performs WebSocket handshake and passes a ``WebSocketClient``
83-
instance to your route.
82+
Applies ``WebSocketMiddleware`` to your Flask App, allowing you to decorate
83+
routes with the ``route`` method, turning them into WebSocket handlers.
84+
85+
Additionally monkey-patches ``app.run``, to run your app directly in uWSGI.
86+
87+
``route(url)``
88+
89+
``run(debug, host, port, **kwargs)``
90+
``**kwargs`` are passed to uWSGI as command line arguments.
8491

8592

8693
``flask_uwsgi_websocket.WebSocketMiddleware``
8794
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
88-
WebSocket Middleware used by ``WebSocket``.
95+
WebSocket Middleware which automatically performs WebSocket handshake and
96+
passes ``WebSocketClient`` instances to your route.
8997

9098

9199
``flask_uwsgi_websocket.WebSocketClient``
92100
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
93101
Exposes the `uWSGI WebSocket API
94102
<http://uwsgi-docs.readthedocs.org/en/latest/WebSockets.html#api>`_.
95103

96-
``WebSocket.recv()`` (alias ``WebSocket.receive()``)
104+
``recv()`` (alias ``WebSocket.receive()``)
97105

98-
``WebSocket.recv_nb()``
106+
``recv_nb()``
99107

100-
``WebSocket.send(msg)``
108+
``send(msg)``
101109

102-
``WebSocket.send_binary(msg)``
110+
``send_binary(msg)``
103111

104-
``WebSocket.recv_nb()``
112+
``recv_nb()``
105113

106-
``WebSocket.send_from_sharedarea(id, pos)``
114+
``send_from_sharedarea(id, pos)``
107115

108-
``WebSocket.send_binary_from_sharedarea(id, pos)``
116+
``send_binary_from_sharedarea(id, pos)``
109117

110118

111119
``flask_uwsgi_websocket.GeventWebSocket``
112120
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
113121
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.
122+
Requires uWSGI to be run with ``--uwsgi`` option.
117123

118124

119125
``flask_uwsgi_websocket.GeventWebSocketMiddleware``
120126
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
121-
WebSocket Middleware used by ``GeventWebSocket``.
127+
Automatically performs WebSocket handshake and passes a ``GeventWebSocketClient`` instance to your route.
122128

123129

124130
``flask_uwsgi_websocket.GeventWebSocketClient``
125131
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
126132
WebSocket client abstraction with fully non-blocking methods.
127133

128-
``websocket.receive()``
134+
``receive()``
129135

130-
``websocket.send(msg)``
136+
``send(msg)``
131137

132-
``websocket.close()``
138+
``close()``
133139

134-
``websocket.connected``
140+
``connected``

0 commit comments

Comments
 (0)