| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
The launchdarkly/python-eventsource package allows Python developers to consume Server-Sent-Events (SSE) from a remote API. The SSE specification is defined here: https://html.spec.whatwg.org/multipage/server-sent-events.html
This package's primary purpose is to support the LaunchDarkly SDK for Python, but it can be used independently. In its simplest configuration, it emulates the behavior of the EventSource API as defined in the SSE specification, with the addition of exponential backoff behavior for retries. However, it also includes optional features used by LaunchDarkly SDKs that are not part of the core specification, such as:
The default SSEClient is a synchronous implementation which blocks the caller's thread when reading events or reconnecting. By default, it uses urllib3 to make HTTP requests, but it can be configured to read any input stream.
An async implementation, AsyncSSEClient, is also available for use with asyncio-based applications. It uses aiohttp for HTTP and requires installing the optional async extra:
pip install launchdarkly-eventsource[async]
Caution
The async implementation (AsyncSSEClient and its associated AsyncConnectStrategy API) is experimental and should NOT be considered ready for production use. It may change or be removed without notice and is not subject to backwards compatibility guarantees.
Pin to a specific minor version and review the changelog before upgrading.
This version of the package is compatible with Python 3.10 and higher.
We encourage pull requests and other contributions from the community. Check out our contributing guidelines for instructions on how to contribute to this SDK.
| Back | FazBrowse Home | New Git URL |