Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve interface of consuming messages #148

Open
akayunov opened this issue Aug 26, 2022 · 2 comments
Open

Improve interface of consuming messages #148

akayunov opened this issue Aug 26, 2022 · 2 comments

Comments

@akayunov
Copy link

suggest to change interface of consuming messages from registering call_back on_message to iterating by some message generator:
something like:

await mq.connect(conf)
await mq.create_channel() 
await mq.declare_queue(queue_name)
await self.mq.queue_bind(queue_name, '#')
**async for msg in self.mq.basic_consume(self.on_message, queue_name):**
    **'do something with message'**

As example looks at websocket handler in aiohttp.

@mosquito
Copy link
Owner

This library is a low level library. aio-pika is a high level wrapper for this library and provides this interface https://aio-pika.readthedocs.io/en/latest/quick-start.html

@akayunov
Copy link
Author

cool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants