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.5.tar.gz (2.6 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.5-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: relaybus_nats-0.0.5.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

Hashes for relaybus_nats-0.0.5.tar.gz
Algorithm Hash digest
SHA256 b810f8ba23eac96223aab54a3c2119e1b562cb9d42087b9aefc413e8e2f4a375
MD5 4b7d38cfd47966bee53f4f5214721b0c
BLAKE2b-256 531689d564a3bef0ba25d1f955af4130e4a76c7d9071ec3210527e50812c42f9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: relaybus_nats-0.0.5-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

Hashes for relaybus_nats-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 846f0b95380895f395b04040db622be82bd79bbf3fd2978589b97878e9355c5f
MD5 aefdc2686c554ed39c057d07e797eca0
BLAKE2b-256 92647bfa264664d22854900d808f609a8f996b7451c1a99c4783930a3d089a50

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