lalala
Project description
PikaHandler
Класс-хендлер для удобной работы с обработкой сообщений из RabbitMQ
Установка
python -m pip install pikahandler
Использование
from pikahandler import PikaHandler
server = '192.168.0.73'
port = 8472
host = "/"
user = "eugene"
password = "spell-thickness-macarena-belie-gawk-fiske-puffy"
# Без авторизации
ph = PikaHandler(server, port, host)
# С авторизацией
ph = PikaHandler(server, port, host, user, password)
# Через connection
import pika
connection = pika.BlockingConnection(pika.ConnectionParameters(server, port, host))
ph = PikaHandler(connection=connection)
@ph.handler("main", lambda r: r["body"] == "HelloWorld")
def helloworld(ch, method, poperties, body):
print(body)
@ph.handler("main", lambda r: r["body"] == "HelloPython")
def hellopython(ch, method, poperties, body):
print(body)
ph.start()
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 Distribution
pikahandler-0.0a1.tar.gz
(3.5 kB
view details)
Built Distribution
File details
Details for the file pikahandler-0.0a1.tar.gz
.
File metadata
- Download URL: pikahandler-0.0a1.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6118f2b8fe84de306f81f724a54eebcaf2e847022319d645602bdaff61ee541 |
|
MD5 | 64ca1c21dd4e315e2342eb307bb61be5 |
|
BLAKE2b-256 | dd8d3bd173366bd672a94a6a6cdb5a32cbccf857800b763b653233754798a70f |
File details
Details for the file pikahandler-0.0a1-py3-none-any.whl
.
File metadata
- Download URL: pikahandler-0.0a1-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01acc5d1475dc42ef1acfd703d8fe287d8a1f5db61f7b6f44c3eb1c8e112f432 |
|
MD5 | 3d6af1cd5b31da1dff8f143e21b4bb06 |
|
BLAKE2b-256 | b2e57f96faf9092ab43d1c0cad2d81beee59ff878c1d84b840a236003c8a87d7 |