diff options
author | Lorenz Diener <[email protected]> | 2018-04-17 16:06:00 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2018-04-17 16:06:00 +0200 |
commit | 2afc50c803177fc282fac1a19fcd40e175d55f2d (patch) | |
tree | 7ce50a932d74a3ad902b6b4b4613c18b33937bb5 /docs | |
parent | 06a7a875fe2705044b98f3ef285944b5513be7de (diff) | |
parent | 864c83fa2fe7e09125a24f4a12acb4b1e285bc02 (diff) | |
download | mastodon.py-2afc50c803177fc282fac1a19fcd40e175d55f2d.tar.gz |
Merge branch 'master' into stream-timeout
Diffstat (limited to 'docs')
-rw-r--r-- | docs/index.rst | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/docs/index.rst b/docs/index.rst index 5a1254d..4de0f6e 100644 --- a/docs/index.rst +++ b/docs/index.rst | |||
@@ -725,18 +725,26 @@ 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 error is encountered). |
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 |
738 | directly is included for convenience. | 742 | directly is included for convenience. |
739 | 743 | ||
744 | When in not-async mode or async mode without async_reconnect, the stream functions may raise | ||
745 | various exceptions: `MastodonMalformedEventError` if a received event cannot be parsed and | ||
746 | `MastodonNetworkError` if any connection problems occur. | ||
747 | |||
740 | .. automethod:: Mastodon.stream_user | 748 | .. automethod:: Mastodon.stream_user |
741 | .. automethod:: Mastodon.stream_public | 749 | .. automethod:: Mastodon.stream_public |
742 | .. automethod:: Mastodon.stream_local | 750 | .. automethod:: Mastodon.stream_local |