Skip to main content

cangling-message (Python)

Producer and consumer for the cangling-message broker. Same contract as the Java client: AcceptMessages to publish, Subscribe to consume, optional Register metadata, AUTH_TOKEN on every RPC.

Install

pip install cangling-message

From this tree:

pip install -e python

Use

from cangling_message import SatwayClient, SubscribeOptions

with SatwayClient.connect("127.0.0.1:7500", "change-me") as client:
    client.send("cangling-test", "hello")
    with client.subscribe(
        SubscribeOptions(topic="cangling-test", name="worker-1"),
        lambda message: print(message.id, message.payload),
    ):
        ...

SatwayClient.connect(broker) also reads AUTH_TOKEN from the environment.

Existing Kafka senders can keep send(topic, value) / flush():

# from kafka import KafkaProducer
from cangling_message import KafkaProducer

producer = KafkaProducer(bootstrap_servers="127.0.0.1:7500")
producer.send(topic, msg)
producer.flush()
# consume
python python/examples/consumer.py --broker 127.0.0.1:7500 --topic cangling-test --name py-s0 --token change-me

# produce
python python/examples/producer.py --broker 127.0.0.1:7500 --topic cangling-test --text hello --count 1 --token change-me

Publish to PyPI

CI on tag v* builds the package and uploads with pypa/gh-action-pypi-publish. Set repository secret PYPI_API_TOKEN.

cd python
python generate_proto.py
python -m build

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cangling_message-0.1.5.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

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

cangling_message-0.1.5-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file cangling_message-0.1.5.tar.gz.

File metadata

  • Download URL: cangling_message-0.1.5.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for cangling_message-0.1.5.tar.gz
Algorithm Hash digest
SHA256 da102a3fd7b376fe9958b56dc2b4ecc9394491bb9c2b3c4381fa9256fdac5ba6
MD5 c19741cf9380adca758cbb9783aa4f4c
BLAKE2b-256 2e12a2965a5d108bd712e1e9d27ba7cdb90c07d3191af9ba441f0cc8c46e3606

See more details on using hashes here.

File details

Details for the file cangling_message-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for cangling_message-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 2d592f41049a02e3feb1f83e8befa6b26a02a24b05986e499f5aca7ee0109e76
MD5 0d72fa84b46ede7cc8a3381b53888b1d
BLAKE2b-256 9bb448899d69d1dec0e04ecacc76b705d24d79cbf6da9bee821c1a37110bdd1f

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.10

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

This release

0.1.5 This release

2 files

0.1.4

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page