Useful RabbitMQ stuff.
Project description
Simplify interactions with RabbitMQ focusing on design patterns based on Topic Exchanges. More information can be found here: http://www.rabbitmq.com/tutorials/tutorial-five-python.html
Embrace Kenneth Reitz’s thoughts on the 90% rule, i.e. requests module.
Messages are serialized as needed, starting from no serialization for strings to json and falling back to yaml if the more simple open serialization methods are not capable of serializing the object/message. i.e. datetime/date/decimal/etc.
#!/usr/bin/env python
from rabbit import Producer
with Producer(uri) as producer:
for message in <iterable/generator>:
producer.publish(message, routing_key)
from rabbit import Consumer
with Consumer(uri, exchange, queue, routing_key) as consumer:
consumer.attach_action(...)
consumer.handle_messages(...)
or for even more control of exchanges and queues:
from rabbit import Consumer
with Consumer(uri) as consumer:
consumer.declare_exchange(...)
consumer.declare_queue(...)
consumer.attach_action(...)
consumer.handle_messages(...)
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
thumper-0.0.01.tar.gz
(6.4 kB
view details)
File details
Details for the file thumper-0.0.01.tar.gz
.
File metadata
- Download URL: thumper-0.0.01.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d73d582d572cdcb75c1a6c0a5ee49bcfc3085320722ec51015a3839b348bc7e |
|
MD5 | a80b7a389a0d931977c631bc7508cae0 |
|
BLAKE2b-256 | 2b0c36ee749c62d5f168966ed0f6dc99a75ffe5379032a5a41af10a819556dc5 |