altdesktop / python-dbus-next

🚌 The next great DBus library for Python with asyncio support
https://python-dbus-next.readthedocs.io/en/latest/
MIT License
187 stars 58 forks source link

Async methods with @method #130

Open thusser opened 1 year ago

thusser commented 1 year ago

Am I missing something or is it not possible to decorate async methods with @method? The wrapped method here is not marked async: https://github.com/altdesktop/python-dbus-next/blob/master/dbus_next/service.py#L90 Should be easy to check, whether fn is a coroutine or not and then either provide an async or normal version of wrapped. Want a PR?

jonasBoss commented 1 year ago

It is already possible using the aio MessageBus. If you are curious why: https://github.com/altdesktop/python-dbus-next/blob/ab566e16a71bfc9d7e0d29676aa459ec060e72c5/dbus_next/aio/message_bus.py#L345