Skip to main content

JustStream

Synchronous event/message processing with pluggable broker adapters

JustStream processes broker messages with ordinary Python task methods and can run them in thread or process pools. It requires Python 3.9 or later.

Installation

Install the client extra for the broker you use. A broker server must be available separately.

python -m pip install "JustStream[RabbitMQ]"

For Redis Streams, install JustStream[Redis]. To install both adapters and clients, use JustStream[RabbitMQ,Redis]. The single JustStream distribution always includes all broker implementation sources, preserving existing import paths; each extra only installs that broker's client dependency.

If you previously installed the separate adapter distributions, uninstall JustStream, JustStream-RabbitMQ and JustStream-Redis, then reinstall JustStream with the desired extras.

Quick start

The following worker listens to a local RabbitMQ server at 127.0.0.1:5672. The example credentials are for local development only.

from signal import SIGINT, signal

from JustStream.Broker.Implements.RabbitMQ import Configuration, Connection, Reject, Subscription
from JustStream import Run, ThreadPool, Worker, WorkerSetup, declare


class Add(
  Run,
  parameters=Subscription(queue='example.add', error='example.add.error'),
  on_error=Reject(),
):
  def run(self, a: int, b: int):
    print(a + b)
    return a + b


class Prepare(WorkerSetup):
  def __call__(self, worker: Worker) -> None:
    for task in worker.tasks:
      declare(task=task, broker=worker.broker)


if __name__ == '__main__':
  worker = Worker(
    Connection(Configuration(host='127.0.0.1', port=5672, username='guest', password='guest')),
    ThreadPool(4),
    setups=Prepare(),
  )
  worker.add(Add)
  signal(SIGINT, lambda *_: worker.stop())
  worker.run()

Run the script after starting RabbitMQ. The worker declares its task queue and waits for messages. Store production credentials outside source code.

License

See the LICENSE file included with the source distribution for the license terms.

Metadata

Release files for JustStream 0.1.32

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for JustStream 0.1.32
File Size Uploaded Provenance Actions
juststream-0.1.32.tar.gz 231.1 kB Without provenance Details for juststream-0.1.32.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for JustStream 0.1.32
File Interpreter ABI Platform Actions
juststream-0.1.32-149-py3-none-any.whl Python 3 none any Details for juststream-0.1.32-149-py3-none-any.whl
juststream-0.1.32-147-py3-none-any.whl Python 3 none any Details for juststream-0.1.32-147-py3-none-any.whl

Total release size: 440.0 kB

Release files / juststream-0.1.32.tar.gz

Download URL juststream-0.1.32.tar.gz
Size 231.1 kB
Tags Source
SHA-256 checksum
How to use checksums
8d92da46afc836dd468c3192ad79fbaaa8bf445f8541bcae47f698788cb5f838
BLAKE2b-256 checksum
How to use checksums
ba1b708074c73e596328096d5acb7c94a4bcee277775090e273b225d36be8941
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.18

Release files / juststream-0.1.32-149-py3-none-any.whl

Download URL juststream-0.1.32-149-py3-none-any.whl
Size 104.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
01d06ee711643ad1cba658621c4eef839f0d96a6d347a15138de63ab059de9fd
BLAKE2b-256 checksum
How to use checksums
516f38a2250a3e6b2746a541a77653271074cefe0de620346b614990527fc100
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.18

Release files / juststream-0.1.32-147-py3-none-any.whl

Download URL juststream-0.1.32-147-py3-none-any.whl
Size 104.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1e5c0f6005d1154f7fa2e31d072f9017ebdc4b56b2070da106e8949d5e0a318b
BLAKE2b-256 checksum
How to use checksums
0015eb8701fc49a5abb1098e69f4916ef7e230c79b12a15426e763c50bef53cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.18

Security for JustStream 0.1.32

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page