Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jeremyarr/mooq
An asyncio compatible library for interacting with a RabbitMQ AMQP broker
https://github.com/jeremyarr/mooq
amqp amqp0-9-1 asyncio python python-3-6 rabbitmq
Last synced: about 22 hours ago
JSON representation
An asyncio compatible library for interacting with a RabbitMQ AMQP broker
- Host: GitHub
- URL: https://github.com/jeremyarr/mooq
- Owner: jeremyarr
- License: mit
- Created: 2017-07-10T08:01:01.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-08-30T01:27:04.000Z (over 7 years ago)
- Last Synced: 2024-12-20T23:51:38.584Z (3 days ago)
- Topics: amqp, amqp0-9-1, asyncio, python, python-3-6, rabbitmq
- Language: Python
- Homepage: http://mooq.readthedocs.io/en/latest/
- Size: 133 KB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.rst
- Contributing: CONTRIBUTING.rst
- License: LICENSE
Awesome Lists containing this project
README
.. image:: docs/_static/logo_full2.png
.. image:: http://tactile.com.au/jenkins/buildStatus/icon?job=mooq1
:target: https://github.com/jeremyarr/mooq.. image:: https://img.shields.io/pypi/l/mooq.svg
:target: https://pypi.python.org/pypi/mooq.. image:: https://tactile.com.au/badge-server/coverage/mooq1
:target: https://github.com/jeremyarr/mooq.. image:: https://img.shields.io/pypi/pyversions/mooq.svg
:target: https://pypi.python.org/pypi/mooq.. image:: https://img.shields.io/pypi/status/mooq.svg
:target: https://pypi.python.org/pypi/mooq.. image:: https://img.shields.io/pypi/implementation/mooq.svg
:target: https://pypi.python.org/pypi/mooq`mooq `_ is an asyncio compatible library for interacting with a `RabbitMQ `_ AMQP broker.
Features
---------- Uses asyncio. No more callback hell.
- Simplified and pythonic API to RabbitMQ
- Built on top of the proven `pika `_ library
- Comes with an in memory broker for unit testing projects that depend on RabbitMQGet It Now
-----------.. code-block:: bash
$ pip install mooq
Just mooq it
--------------Creating a connection:
.. code-block:: python
conn = await mooq.connect(
host="localhost",
port=5672,
broker="rabbit"
)Creating a channel of the connection:
.. code-block:: python
chan = await conn.create_channel()
Registering a producer:
.. code-block:: python
await chan.register_producer(
exchange_name="log",
exchange_type="direct")Registering a consumer and associated callback:
.. code-block:: python
async def yell_it(resp):
print(resp['msg'].upper())await chan.register_consumer(
exchange_name="log",
exchange_type="direct",
routing_keys=["greetings","goodbyes"],
callback = yell_it)Publishing a message:
.. code-block:: python
await chan.publish(exchange_name="log",
msg="Hello World!",
routing_key="greetings")Process messages asynchronously, running associated callbacks:
.. code-block:: python
loop = asyncio.get_event_loop()
loop.create_task(conn.process_events())More at https://mooq.readthedocs.io
-------------------------------------Project Links
-------------- Docs: https://mooq.readthedocs.io/
- Changelog: https://mooq.readthedocs.io/en/latest/changelog.html
- PyPI: https://pypi.python.org/pypi/mooq
- Issues: https://github.com/jeremyarr/mooq/issuesLicense
-------MIT licensed. See the bundled `LICENSE `_ file for more details.