clue-mq-0.1.2
توضیحات
Message Queue Tools for python project
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | clue-mq-0.1.2 |
| نام | clue-mq |
| نسخه کتابخانه | 0.1.2 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Linewalks |
| ایمیل نویسنده | jindex2411@linewalks.com |
| آدرس صفحه اصلی | https://github.com/linewalks/CLUE-MQ |
| آدرس اینترنتی | https://pypi.org/project/clue-mq/ |
| مجوز | Linewalks |
# CLUE-MQ
### Quick start
#### subscriber
```python
from clue_mq import ClueMQ
cluemq = ClueMQ(
host="localhost", # your Message Queue host ex) redis://0.0.0.0, amqp://id:password@0.0.0.0:port
exchange_list=[("clue", "topic")],
accept_type="json" # 전송 받을 data type
)
# subscribe을 통해서 함수의 구독이 가능함
# 구독한 함수 이름의 큐가 만들어 지며 설정한 routing key로 바인딩
#cluemq.{exchange}.subscribe("바인딩 시킬 라우팅 키")
@cluemq.clue.subscribe("test_routing_key")
def test_function(x, y):
return x + y
if __name__ == "__main__":
# run_subscribers 함수를 통해서
# 지금까지 설정된 큐와 큐의 메세지를 소비하는 Comsumer를 생성 해줌
cluemq.run_subscribers()
```
#### Publisher
```python
from clue_mq import ClueMQ
cluemq = ClueMQ(
host="localhost", # your Message Queue host ex) redis://0.0.0.0, amqp://id:password@0.0.0.0:port
exchange_list=[("clue", "topic")],
accept_type="json" # 전송 받을 data type
)
#cluemq.{exchange}.send_message(전송 데이터 dict type, "요청을 보낼 라우팅키")
cluemq.clue.send_message({"x": 1, "y": 2}, "test_routing_key")
```
نیازمندی
| مقدار | نام |
|---|---|
| - | kombu |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6 | Python |
نحوه نصب
نصب پکیج whl clue-mq-0.1.2:
pip install clue-mq-0.1.2.whl
نصب پکیج tar.gz clue-mq-0.1.2:
pip install clue-mq-0.1.2.tar.gz