dutradda / asyncapi-python

Publish events using broadcaster lib from asyncapi specification
The Unlicense
42 stars 1 forks source link

AMQP support #6

Open themanifold opened 3 years ago

themanifold commented 3 years ago

Are there plans to support AMQP? And if there are not, could you point me to the right places in the code so that maybe I could try and implement it myself?

themanifold commented 3 years ago

Ah, I see we're using the https://github.com/encode/broadcaster library, which doesn't yet support AMQP, though it doesn't seem too hard to implement the methods that are needed using something like https://github.com/mosquito/aiormq

themanifold commented 3 years ago

I'm thinking that I need to implement the following methods in asyncacpi/events/backends/amqp.py

class AmqpBackend():
    def __init__():
        pass

    async def connect():
        pass

    async def disconnect():
        pass

    async def publish():
        pass

    async def subscribe():
        pass

and at least the subscribe method need to yield .event as I see it in api.py:listen.