bovine_pubsub
Note: Development of bovine_pubsub will probably be discontinued
bovine_pubsub is a simple wrapper to enable server sent events in bovine. These are used to communicate real time with clients without forcing them to use polling. If multiple workers are used with bovine, one needs to use Redis as the implementation with queues only works for a single process.
Starting with bovine-pubsub support for server side clients is available using AMQP. See examples/bovine_listen.py for details.
Usage
The simplest usage example is given by
from quart import Quart
from bovine_pubsub import BovinePubSub
app = Quart(__name__)
BovinePubSub(app)
it adds the config variable app.config["bovine_pub_sub"] to the Quart application. By calling
await app.config["bovine_pub_sub"].send("channel:test", b"test")
one sends the bytes b"test" to the channel channel:test. By calling
pub_sub.event_stream("channel:test")
one receives an async iterator that can be used as server sent events.
Example usage
A usage example is provided by examples/basic_app.py. By running
python examples/basic.app
one can start a server that sends "test" 10 times a new socket is opened on localhost:5000. The above implementation will use the local queues. To use with Redis start
BOVINE_REDIS=redis://localhost:6379 python examples/basic_app.py
with an appropriate value for the environment variable BOVINE_REDIS.
Running tests
Testing redis can be done inside of the docker compose setup, e.g.
docker compose up -d
docker compose run main /bin/sh
cd bovine_pubsub
poetry install
poetry run pytest
BOVINE_REDIS=redis://redis:6379 poetry run pytest
BOVINE_AMQP=amqp://rabbitmq poetry run pytest
Metadata
Release files for bovine-pubsub 0.5.19
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| bovine_pubsub-0.5.19.tar.gz | 4.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bovine_pubsub-0.5.19-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.1 kB
Release files / bovine_pubsub-0.5.19.tar.gz
| Download URL | bovine_pubsub-0.5.19.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
58123276f21f8ebb85a3af0f444236286fec4dae8a12280bbedfee6b678a1759
|
|
BLAKE2b-256 checksum How to use checksums |
ea9445fc224bec0468521f512f50a0461e7bec61c6c84b6a45a50c4b750c8f78
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.11.3 Linux/6.12.32+bpo-amd64
|
Release files / bovine_pubsub-0.5.19-py3-none-any.whl
| Download URL | bovine_pubsub-0.5.19-py3-none-any.whl |
|---|---|
| Size | 6.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e0568a3ed5d31689674e07d0a1e5b8b58e6d06be685e1a01acc15acc4ef4ccc1
|
|
BLAKE2b-256 checksum How to use checksums |
cfad98581f88d1b4e4dd6b24fa53176dc2369b6c12b07d5e410e958dc112d5d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.11.3 Linux/6.12.32+bpo-amd64
|
Security for bovine-pubsub 0.5.19
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.