Relaybus NATS publisher and subscriber
Project description
relaybus-nats (Python)
NATS publisher and subscriber utilities for Relaybus.
Install
pip install relaybus-nats
Example
from relaybus_core import OutgoingMessage
from relaybus_nats import (
NatsPublisher,
NatsPublisherConnectConfig,
NatsSubscriber,
NatsSubscriberConnectConfig,
)
publisher = NatsPublisher.connect(NatsPublisherConnectConfig(url="nats://localhost:4222"))
publisher.publish("alpha", OutgoingMessage(topic="alpha", payload=b"hello"))
subscriber = NatsSubscriber.connect(
NatsSubscriberConnectConfig(
url="nats://localhost:4222",
subject_prefix="relaybus",
on_message=lambda msg: print(msg.topic, msg.payload),
)
)
subscriber.start("alpha")
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
relaybus_nats-0.0.3.tar.gz
(2.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file relaybus_nats-0.0.3.tar.gz.
File metadata
- Download URL: relaybus_nats-0.0.3.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a71db6396484e972f555bdbaaa4ee805763d4a43938721e426d92f4ce06ff7a9
|
|
| MD5 |
ae599bced8ee9d45c1e53b81ae34ceab
|
|
| BLAKE2b-256 |
b48c0c0e41f289d3fc47f3915a34d0e8b33e52d0cd273aaa86d69880ff8603ea
|
File details
Details for the file relaybus_nats-0.0.3-py3-none-any.whl.
File metadata
- Download URL: relaybus_nats-0.0.3-py3-none-any.whl
- Upload date:
- Size: 2.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5cc415b12f223d79b608287b8f8c1f316de5d7a588d69655ca46fff7401fa33b
|
|
| MD5 |
93e815d4d479feafae174aebf674e8c1
|
|
| BLAKE2b-256 |
e30f7e9cdad71ab9d651524fd7c10f93814eaaa79a49fe94444b3146e63fa840
|