aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'docs/index.rst')
-rw-r--r--docs/index.rst20
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---------
726These functions allow access to the streaming API. 726These functions allow access to the streaming API.
727 727
728If async is False, these methods block forever (or until an 728If `async` is False, these methods block forever (or until an error is encountered).
729exception is raised).
730 729
731If async is True, the listener will listen on another thread and these methods 730If `async` is True, the listener will listen on another thread and these methods
732will return a handle corresponding to the open connection. The 731will return a handle corresponding to the open connection. If, in addition, `async_reconnect` is True,
733connection may be closed at any time by calling the handles close() method, and the 732the thread will attempt to reconnect to the streaming API if any errors are encountered, waiting
734status 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
734to "catch up" - toots made while the connection is broken will not be received.
735
736The connection may be closed at any time by calling the handles close() method. The
737current status of the handler thread can be checked with the handles is_alive() function,
738and the streaming status can be checked by calling is_receiving().
735 739
736The streaming functions take instances of `StreamListener` as the `listener` parameter. 740The streaming functions take instances of `StreamListener` as the `listener` parameter.
737A `CallbackStreamListener` class that allows you to specify function callbacks 741A `CallbackStreamListener` class that allows you to specify function callbacks
738directly is included for convenience. 742directly is included for convenience.
739 743
744When in not-async mode or async mode without async_reconnect, the stream functions may raise
745various 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
Powered by cgit v1.2.3 (git 2.41.0)