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

Uploaded Python 3

File details

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

File metadata

  • Download URL: relaybus_nats-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 4742171deae4251e5831f05eb35bbcf06b6d7a20abc7bc3a0d008e968b5b3e0b
MD5 1411f3590f39edd7e5d3774e76c18ac5
BLAKE2b-256 ff6c25c648a978fcb8a178e02e832c64f1ee09fa57939da8c01be200d905e1f1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: relaybus_nats-0.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ce056788d844354ca9e9bccc645bdc10c592054765d8d097b10bb76b9bb4131a
MD5 08ad4bafc3e99c293910bd65e530c54c
BLAKE2b-256 887b67a011a92a84397a5aee2af55d75e8d49e89c54e4b7d18a15686cfbaf146

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