diff options
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 |