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.9.tar.gz
(3.7 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.9.tar.gz.
File metadata
- Download URL: relaybus_nats-0.0.9.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0a48fad8025425ef531605bcb66ea115b62bea70c0ba1d233e85931a02cd733
|
|
| MD5 |
c78de51c9f185432d719844fffe2f1a1
|
|
| BLAKE2b-256 |
8342ef014e23feeff43ea6682409216dfab22ca6693e537f2b017df30e9880c2
|
File details
Details for the file relaybus_nats-0.0.9-py3-none-any.whl.
File metadata
- Download URL: relaybus_nats-0.0.9-py3-none-any.whl
- Upload date:
- Size: 4.3 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 |
9c45d448b235427cf9069f00576014ce17aabf81dfa8f3b5dba67e6e6e99bff0
|
|
| MD5 |
e9f331aaa920eec622dfe2e62fcd3cc8
|
|
| BLAKE2b-256 |
aa9be538a59ea2382e918aef6c715272233af02d5503320132a3f74e550fb3f0
|