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 plain JustStream installation includes neither broker implementation nor client. Each extra installs a separate, same-version adapter distribution, preserving existing import paths.

Before migrating an older integrated installation or historical standalone adapters, uninstall JustStream, JustStream-RabbitMQ and JustStream-Redis, then reinstall with the desired extras. Omitting an extra later does not remove an already installed adapter.

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.Worker 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.30

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.30
File Size Uploaded Provenance Actions
juststream-0.1.30.tar.gz 230.4 kB Without provenance Details for juststream-0.1.30.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for JustStream 0.1.30
File Actions
juststream-0.1.30-144-py3-none-any.whl Python 3 none any Details for juststream-0.1.30-144-py3-none-any.whl
juststream-0.1.30-141-py3-none-any.whl Python 3 none any Details for juststream-0.1.30-141-py3-none-any.whl
juststream-0.1.30-138-py3-none-any.whl Python 3 none any Details for juststream-0.1.30-138-py3-none-any.whl
juststream-0.1.30-136-py3-none-any.whl Python 3 none any Details for juststream-0.1.30-136-py3-none-any.whl

Total release size: 593.0 kB

Release files / juststream-0.1.30.tar.gz

Download URL juststream-0.1.30.tar.gz
Size 230.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a7ce653c1631959aa511dcd574a12a1cbbb7bf4848f738721cd396960e6d23d0
BLAKE2b-256 checksum
How to use checksums
70c8b5169a610e6c3913b1ca305f9dcf82769c6531690af6cc9af0d96702b9e1
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.30-144-py3-none-any.whl

Download URL juststream-0.1.30-144-py3-none-any.whl
Size 104.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
92af1d5657809f001c434c20f33b7fb0be62bfac24d41fa4287a7a9f1707fc31
BLAKE2b-256 checksum
How to use checksums
6e87ad52ff118643cfa50d92ef69b67b01829e4c1aafd06b32a9f7eed0ffd28c
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.30-141-py3-none-any.whl

Download URL juststream-0.1.30-141-py3-none-any.whl
Size 104.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2eff27807db29f73401e2b4e2951f8caeb9aedf23a64373388aa0b45667a56ac
BLAKE2b-256 checksum
How to use checksums
93bae78cac34eb70d37caa28537e27cd08633a0329d689f9b5e0eabc77888023
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.30-138-py3-none-any.whl

Download URL juststream-0.1.30-138-py3-none-any.whl
Size 76.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
977b978ed6e3dfc95c607cb7c5cdaa0915f90fc4933fe38812e23a772043d147
BLAKE2b-256 checksum
How to use checksums
ee7d36046efa43df92f8c7e052eef79b8054331fd86cf55afbab6cceff33034a
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.30-136-py3-none-any.whl

Download URL juststream-0.1.30-136-py3-none-any.whl
Size 76.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ad8dfd8ca90e02253376e542ca14c12e6a9d37c48a8d24cca2411ce7f2a36dcc
BLAKE2b-256 checksum
How to use checksums
cff962d2e80d2c1fe11ec79a1992384e567cef6e58773e1e6b4152d6cd6e3d34
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.30

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