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.7.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.7-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file relaybus_nats-0.0.7.tar.gz.

File metadata

  • Download URL: relaybus_nats-0.0.7.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.7.tar.gz
Algorithm Hash digest
SHA256 d859b26e756596de9da5a8311be8391ab56607d23f63af3c1b72a537e70eef98
MD5 fcf299cfdd3b533c9f38cbdf649030a3
BLAKE2b-256 f4fb7e34f5280a1486c3a5efab10138fba9e60d9ae8f1a65bd8cd41ec0a4489a

See more details on using hashes here.

File details

Details for the file relaybus_nats-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: relaybus_nats-0.0.7-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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 bc415d739e9bb71312a6052fe83e0c03fb2233672c3a4970ca0fcfca929a8d31
MD5 d2f2c88ba07ebc6bbcd078b0998038a6
BLAKE2b-256 eec3515e4a65befd03322d6a36e7756b18d7fb2fb9a57b8cb5ad43d9c09b21ab

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