diff options
author | Lorenz Diener <[email protected]> | 2018-04-17 15:10:40 +0200 |
---|---|---|
committer | Lorenz Diener <[email protected]> | 2018-04-17 15:10:40 +0200 |
commit | 400faadc0deeb352d78291857cd6a2c8b8c528d3 (patch) | |
tree | cb212cb73a5962422a20ce26096d568dedb0050f | |
parent | eb336a30c2ef04c2b0f66727de1bc585ad96e2da (diff) | |
download | mastodon.py-400faadc0deeb352d78291857cd6a2c8b8c528d3.tar.gz |
Document new async behaviour a bit
-rw-r--r-- | docs/index.rst | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/docs/index.rst b/docs/index.rst index 5a1254d..f463156 100644 --- a/docs/index.rst +++ b/docs/index.rst | |||
@@ -725,13 +725,17 @@ Streaming | |||
725 | --------- | 725 | --------- |
726 | These functions allow access to the streaming API. | 726 | These functions allow access to the streaming API. |
727 | 727 | ||
728 | If async is False, these methods block forever (or until an | 728 | If `async` is False, these methods block forever (or until an exception is raised). |
729 | exception is raised). | ||
730 | 729 | ||
731 | If async is True, the listener will listen on another thread and these methods | 730 | If `async` is True, the listener will listen on another thread and these methods |
732 | will return a handle corresponding to the open connection. The | 731 | will return a handle corresponding to the open connection. If, in addition, `async_reconnect` is True, |
733 | connection may be closed at any time by calling the handles close() method, and the | 732 | the thread will attempt to reconnect to the streaming API if any errors are encountered, waiting |
734 | status of the connection can be verified calling is_alive() on the handle. | 733 | `async_reconnect_wait_sec` seconds between reconnection attempts. Note that no effort is made |
734 | to "catch up" - toots made while the connection is broken will not be received. | ||
735 | |||
736 | The connection may be closed at any time by calling the handles close() method. The | ||
737 | current status of the handler thread can be checked with the handles is_alive() function, | ||
738 | and the streaming status can be checked by calling is_receiving(). | ||
735 | 739 | ||
736 | The streaming functions take instances of `StreamListener` as the `listener` parameter. | 740 | The streaming functions take instances of `StreamListener` as the `listener` parameter. |
737 | A `CallbackStreamListener` class that allows you to specify function callbacks | 741 | A `CallbackStreamListener` class that allows you to specify function callbacks |