Skip to main content

Relaybus HTTP publisher and subscriber

Project description

relaybus-http (Python)

HTTP publisher and subscriber utilities for Relaybus.

Install

pip install relaybus-http

Example

from relaybus_core import OutgoingMessage
from relaybus_http import (
    HttpPublisher,
    HttpPublisherConnectConfig,
    HttpSubscriber,
    HttpSubscriberConfig,
    HttpSubscriberListenConfig,
)

subscriber = HttpSubscriber(
    HttpSubscriberConfig(
        on_message=lambda msg: print(msg.topic, msg.payload),
    )
)
subscriber.listen(HttpSubscriberListenConfig(port=8088))

publisher = HttpPublisher.connect(
    HttpPublisherConnectConfig(endpoint="http://localhost:8088/{topic}")
)
publisher.publish("relaybus.demo", OutgoingMessage(topic="relaybus.demo", payload=b"hello"))

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_http-0.0.2.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

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

relaybus_http-0.0.2-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: relaybus_http-0.0.2.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for relaybus_http-0.0.2.tar.gz
Algorithm Hash digest
SHA256 2c61502c80faa92896168d46f59903e247cbb9e6120e2b33fc3182d37a89f292
MD5 ce67aebbb7a39eb6dcd7fcc4f99b1d68
BLAKE2b-256 69bbe70fb306815264cdd7231f5b950abc1a1fd629b5d3712ac443dbb1ee48fc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: relaybus_http-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 2.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for relaybus_http-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 056310a48afe53b433d3881bd674728bf03b850073f6a5aa5205271bf29625f3
MD5 bfd6bb4cee064775c915f0275dac0155
BLAKE2b-256 0956776ea08653a793f12bb649bd75260ac053ce506274a23aacd6d576b885e7

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