SodaMQ客户端库,用于消息队列通信
Project description
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
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.5.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.5.tar.gz.
File metadata
- Download URL: soda_mq_client-0.1.5.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64f09c492b07bf99e0d7168912406c8d757968dedbcc7bbde960f80ef3f3df72
|
|
| MD5 |
92091ebb1125f93bf753f21ce2c99c46
|
|
| BLAKE2b-256 |
052c768dda3a81bb0bcb6ea51957a529530ca453c2c522ee880cd8b078396fd8
|
File details
Details for the file soda_mq_client-0.1.5-py3-none-any.whl.
File metadata
- Download URL: soda_mq_client-0.1.5-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9058bfa59b2e7fcfa9b5f8e49e99c419f9161e6d7604ad3978c538978ca6d7a6
|
|
| MD5 |
afd82cad231c15e7c0e0f7228690bcbd
|
|
| BLAKE2b-256 |
95e01163ec609c4eba8d1298cb866b3ea4dcdf74f727132429382d455f73fa6a
|