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

Uploaded Python 3

File details

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

File metadata

  • Download URL: relaybus_nats-0.0.8.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.8.tar.gz
Algorithm Hash digest
SHA256 52348d77fe4adc79567661fde3955cf7ba199458b961cf5b1ac1e9d8ba83c5af
MD5 4028670bf4e86f1b33321a9bbcb95d3e
BLAKE2b-256 4ce697eb5fa0a42f07f7951e724a1e4a5804b54aa385c92d4ac2c6b6a4fccec0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: relaybus_nats-0.0.8-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.8-py3-none-any.whl
Algorithm Hash digest
SHA256 074a50570f41319525da3d85efc94e381a50097011b1c4605015d561bde62033
MD5 271cd32c43112f7500060948d69f4876
BLAKE2b-256 ccb191f7130ab1970e43817b54b7f3129cc70453513544dcc867a262f38c53af

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