Message Queue Tools for python project
Project description
CLUE-MQ
Quick start
subscriber
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
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")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file clue_mq-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: clue_mq-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29be66de730c2878d248e4619e00f96e4b70cae7a88beeb31205929057660fe0 |
|
MD5 | a88c6c5d745de817bd3f4d329cbc3436 |
|
BLAKE2b-256 | 30b7eb6d1e3355e3ed6c73f14981fe49727900566c67c066e25a80db3d91ecc0 |