You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/guides.rst
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,13 +19,13 @@ Eager tasks do not wait for the next event loop cycle and get executed immediate
19
19
See `echo_client_async_callbacks.py <https://raw.githubusercontent.com/tarasko/picows/master/examples/echo_client_async_callbacks.py>`_
20
20
illustrating this approach.
21
21
22
-
If you need an async get_message(), similar to what aiohttp and websockets offer, than you would have to use asyncio.Queue.
22
+
If you need an async receive_message(), similar to what aiohttp and websockets offer, then you would have to use asyncio.Queue.
23
23
The latency penalty will become bigger, since awaiting coroutine can only be woken up on the next event loop cycle
24
24
and message payload will always have to be copied.
25
25
See `echo_client_async_iteration.py <https://raw.githubusercontent.com/tarasko/picows/master/examples/echo_client_async_iteration.py>`_
26
26
illustrating this approach.
27
27
28
-
**picows** let you choose the best possible approach for your project. Very often turning async is not really necessary on
28
+
**picows** lets you choose the best possible approach for your project. Very often turning async is not really necessary on
29
29
the data path. With **picows** you can delay this and do it only when necessary, for example, only when you actually have to start
30
30
some async operation.
31
31
@@ -77,10 +77,10 @@ debug logging.
77
77
Exceptions handling
78
78
-------------------
79
79
80
-
When talking about how library deals with exceptions, there are 2 questions that
80
+
When talking about how the library deals with exceptions, there are two questions that
81
81
must be addressed:
82
82
83
-
**What kinds of exceptions can the library functions throws?**
83
+
**What kinds of exceptions can the library functions throw?**
84
84
85
85
**picows** may raise any exception that the underlying system calls may raise.
86
86
For example, `ConnectionResetError` from :any:`ws_connect` or `BrokenPipeError`
@@ -113,7 +113,7 @@ From the user's perspective, these frames function like regular frames and may c
113
113
114
114
**picows** offers an efficient 'auto ping' mechanism to automatically send a PING to the remote peer after a specified period of inactivity and to handle and verify PONG responses. If no PONG is received, the WebSocket will be disconnected.
115
115
116
-
This behaviour is controlled by the 3 parameters passed to :any:`ws_connect` or :any:`ws_create_server`:
116
+
This behavior is controlled by three parameters passed to :any:`ws_connect` or :any:`ws_create_server`:
117
117
118
118
.. code-block:: python
119
119
@@ -126,7 +126,7 @@ This behaviour is controlled by the 3 parameters passed to :any:`ws_connect` or
126
126
127
127
128
128
Furthermore, it is possible to customize what will be ping and pong frames.
129
-
Apart from PING/PONG msg types other common options are:
129
+
Apart from PING/PONG message types, other common options are:
130
130
131
131
* TEXT frames with 'ping' and 'pong' payload.
132
132
* TEXT frames with full json payload like {"op": "ping"} and {"op": "pong"}
@@ -198,13 +198,13 @@ Measuring/checking round-trip time
198
198
----------------------------------
199
199
`Available since 1.5`
200
200
201
-
**picows** allows to conveniently measure round-trip time to a remote peer using
202
-
:any:`measure_roundtrip_time`. This is done by sending PING request multiple
201
+
**picows** allows you to conveniently measure round-trip time to a remote peer using
202
+
:any:`measure_roundtrip_time`. This is done by sending PING requests multiple
203
203
times and measuring response delay.
204
204
205
-
Checkout an `okx_roundtrip_time.py <https://raw.githubusercontent.com/tarasko/picows/master/examples/okx_roundtrip_time.py>`_
205
+
Check out `okx_roundtrip_time.py <https://raw.githubusercontent.com/tarasko/picows/master/examples/okx_roundtrip_time.py>`_
206
206
example of how to measure RTT to a popular OKX crypto-currency exchange and initiate
207
-
reconnect if it doesn't satisfy a predefined threshold.
207
+
reconnect if it does not satisfy a predefined threshold.
208
208
209
209
Dealing with slow clients
210
210
-------------------------
@@ -236,7 +236,7 @@ Using proxies
236
236
237
237
:any:`ws_connect` supports HTTP, SOCKS4 and SOCKS5 proxies via
0 commit comments