SodaMQ客户端库,用于消息队列通信
Project description
SodaMQ Client
SodaMQ客户端库,用于通过SignalR协议进行消息队列通信。
安装
pip install soda-mq-client
基本用法
创建客户端
from core.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
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
soda_mq_client-0.1.1.tar.gz
(4.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file soda_mq_client-0.1.1.tar.gz.
File metadata
- Download URL: soda_mq_client-0.1.1.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d1151364c7c8d2f08c75fa5f494ea75d4c3ed1adb58432a0903deb40948eb54
|
|
| MD5 |
b2c8f3634509e0087239af2f6ac4db5a
|
|
| BLAKE2b-256 |
817488139810cfeb438a90f0e464d5fc220bbaa066bc03b4a0bc11aea4d3bc38
|
File details
Details for the file soda_mq_client-0.1.1-py3-none-any.whl.
File metadata
- Download URL: soda_mq_client-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db4fdd1c9bfb0deb281fb43e1b69b23ddd897819b06ae695f99df5a3d056a3b5
|
|
| MD5 |
ab28166366b6807220f9bbccef215657
|
|
| BLAKE2b-256 |
dad38bbef3612dbac4d49a0881a235891253e49a13a12afcac8c2e977344afb0
|