python-dbus-next icon indicating copy to clipboard operation
python-dbus-next copied to clipboard

AnyIO implementation of BaseMessagebus

Open thedrow opened this issue 6 years ago • 4 comments

It'd be useful for those who use trio instead of asyncio if this library supported both. AnyIO is a library which provides an abstraction over different event loop implementations. Would you accept a patch that uses it instead of plain asyncio?

thedrow avatar Aug 10 '19 09:08 thedrow

I'm interested in hearing more about what would be required for this.

acrisci avatar Aug 10 '19 16:08 acrisci

Well we'd need to rewrite your socket code to use AnyIO. You just have to specify which backend you want to use. See the documentation for details.

thedrow avatar Aug 12 '19 09:08 thedrow

Oh ok I don't know that sounds like a lot changes. Let me make an alternative suggestion.

I've designed the library to be extended like this the best I could. Instead of doing that rewrite, you should be able to make your own BaseMessageBus implementation using that backend. This is basically just the message bus without any socket stuff.

That abstraction isn't perfect and there's a lot of opportunity to improve it to make it easier to use.

I would accept a new implementation of BaseMessageBus for AnyIO into the project.

acrisci avatar Aug 12 '19 14:08 acrisci

If I can give my 2 cent... asyncio is in the standard library anyio is not...

nicola-lunghi avatar Nov 13 '19 12:11 nicola-lunghi