Skip to main content

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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

relaybus_nats-0.0.9-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

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

Hashes for relaybus_nats-0.0.9.tar.gz
Algorithm Hash digest
SHA256 a0a48fad8025425ef531605bcb66ea115b62bea70c0ba1d233e85931a02cd733
MD5 c78de51c9f185432d719844fffe2f1a1
BLAKE2b-256 8342ef014e23feeff43ea6682409216dfab22ca6693e537f2b017df30e9880c2

See more details on using hashes here.

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

Hashes for relaybus_nats-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 9c45d448b235427cf9069f00576014ce17aabf81dfa8f3b5dba67e6e6e99bff0
MD5 e9f331aaa920eec622dfe2e62fcd3cc8
BLAKE2b-256 aa9be538a59ea2382e918aef6c715272233af02d5503320132a3f74e550fb3f0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page