Minimal working example for Nicegui and Rabbitmq #3773
Twansklaf
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi community,
I couldn't find examples of consuming messages from RabbitMQ and using UI components from nicegui, so I pulled my hair a little bit building this example as I find the integration of both those packages asyncio non trivial. Many other methods I have tried were blocking one of the two event loops, despite trying multiple methods documented in nicegui's reference or GH issues.
I usually use pika to interact with RabbitMQ instances, but in this case there is no way I could make it work. I then picked aiormq that provides a fully asyncio-based RMQ implementation, with a syntax that is very close to pika's.
This simple example runs with docker compose.
compose.yaml
producer.py
consumer.py
Beta Was this translation helpful? Give feedback.
All reactions