fedora-infra / fedora-messaging

A library for sending AMQP messages with JSON schema in Fedora infrastructure
GNU General Public License v2.0
52 stars 52 forks source link

feat: Add asyncio support to publish function #336

Open nwekealex65 opened 4 months ago

nwekealex65 commented 4 months ago

This pull request addresses issue #303

Changes Made:

Related Issue: Issue #303

Please review and provide feedback. Thank you!

abompard commented 4 months ago

The problem that needs fixing is that we want to allow asyncio applications to publish messages within the asyncio framework, not needing the thread pool. So what we need is an async publish function, not a sync publish function that calls asyncio.run(). This is why it's harder, we need to find a way to integrate the async function in Twisted.

nwekealex65 commented 4 months ago

The problem that needs fixing is that we want to allow asyncio applications to publish messages within the asyncio framework, not needing the thread pool. So what we need is an async publish function, not a sync publish function that calls asyncio.run(). This is why it's harder, we need to find a way to integrate the async function in Twisted.

So how do we go about this? Any suggestion?

abompard commented 4 months ago

Well I have started working on it a couple months ago, spent a few days on it and stopped because I had other things to do and it was taking too long. I would suggest finding another issue, as I said before this one is definitely not a simple issue. If you manage do to that before the end of March, you should mentor me ;-)