Skip to main content

SodaMQ Client

SodaMQ客户端库,用于通过SignalR协议进行消息队列通信。

安装

pip install soda-mq-client

基本用法

创建客户端

from soda_mq.soda_client import SodaClient

# 创建SodaMQ客户端
client = SodaClient("http://your-sodamq-server-url")

# 连接到服务器
client.connect()

发送消息

# 向指定主题发送消息
client.send_message("your-topic", {"key": "value"})

订阅主题

# 定义消息处理函数
def on_message(message):
    print(f"收到消息: {message}")

# 订阅主题
client.subscribe("your-topic", on_message)

断开连接

# 断开连接
client.disconnect()

高级用法

请参考core目录下的soda_producer.py和soda_consumer.py文件了解更多高级用法。

许可证

MIT

Metadata

Release files for soda-mq-client 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for soda-mq-client 0.1.5
File Size Uploaded
soda_mq_client-0.1.5.tar.gz 4.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for soda-mq-client 0.1.5
File Interpreter ABI Platform
soda_mq_client-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 9.2 kB

Release files / soda_mq_client-0.1.5.tar.gz

Download URL soda_mq_client-0.1.5.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
64f09c492b07bf99e0d7168912406c8d757968dedbcc7bbde960f80ef3f3df72
BLAKE2b-256 checksum
How to use checksums
052c768dda3a81bb0bcb6ea51957a529530ca453c2c522ee880cd8b078396fd8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.18

Release files / soda_mq_client-0.1.5-py3-none-any.whl

Download URL soda_mq_client-0.1.5-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9058bfa59b2e7fcfa9b5f8e49e99c419f9161e6d7604ad3978c538978ca6d7a6
BLAKE2b-256 checksum
How to use checksums
95e01163ec609c4eba8d1298cb866b3ea4dcdf74f727132429382d455f73fa6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.18

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.1

2 release files

0.1.0

2 release 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