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.4.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.4.tar.gz.
File metadata
- Download URL: relaybus_nats-0.0.4.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 |
87d846a83c714197cbe1b14810acde22ddc9cc04bf1488090b3cd95315ab1753
|
|
| MD5 |
3340764c4f3b954a54a486cd93854434
|
|
| BLAKE2b-256 |
3ec0d779dd0268444f8c08c87812644513111216bebc305e36200e1bd0940116
|
File details
Details for the file relaybus_nats-0.0.4-py3-none-any.whl.
File metadata
- Download URL: relaybus_nats-0.0.4-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 |
fa84b1abf0fe3270d9d816387195ea877be13fb712692717be7c98fe5c52eb55
|
|
| MD5 |
ad80d1db09e12c6205116f001dd9718e
|
|
| BLAKE2b-256 |
edfc50cc41a2a5e7604d7f6bc5a9e38e07054151544bab92db15e8b2a81fd3e3
|