LEW21 / pydbus

Pythonic DBus library
GNU Lesser General Public License v2.1
326 stars 76 forks source link

Support asynchronous calls (#58) #63

Open poncovka opened 6 years ago

poncovka commented 6 years ago

Added support for asynchronous calls of methods. A method is called synchronously unless its callback parameter is specified. A callback is a function f(*args, returned=None, error=None), where args is callback_args specified in the method call, returned is a return value of the method and error is an exception raised by the method.

Example of an asynchronous call:

def func(x, y, returned=None, error=None):
  pass

proxy.Method(a, b, callback=func, callback_args=(x, y))
jkonecny12 commented 6 years ago

This would be really valuable for our use case. Could this be merged please?

johan-bjareholt commented 6 years ago

This is a blocker for me, without this I cannot switch from python-dbus to pydbus and then switch over to python3. @LEW21, please take a loot at this PR!

jkonecny12 commented 6 years ago

@johan-bjareholt in case you are using Fedora distribution it is packaged with this patch there. It would be great to have it in upstream, however the maintainer here is too unresponsive :(.

johan-bjareholt commented 6 years ago

@jkonecny12 Oh, thanks for the tip. Sadly I'm stuck with a debian environment for this project though.

M4rtinK commented 6 years ago

@jkonecny12 Oh, thanks for the tip. Sadly I'm stuck with a debian environment for this project though.

In any case, these are the patches we apply on top of the Fedora package:

https://src.fedoraproject.org/rpms/python-pydbus/tree/master

SpotlightKid commented 5 years ago

I also would like to switch from python-dbus to pydbus but until asynchronous calls are supported I can't. Please review and, if possible, merge this PR and make a new release.

SpotlightKid commented 4 years ago

Just a friendly reminder, asking to look at this PR and, if possible, merge it and make a new release.

Or, at least, if this project is not actively maintained anymore, make a prominent note of it in the readme.

marioortizmanero commented 4 years ago

It really seems inactive, someone should make a fork to keep this alive

SpotlightKid commented 4 years ago

I just wrote a personal email to the repo owner, asking him basically the same as in my comment above.

marioortizmanero commented 4 years ago

Any news?

SpotlightKid commented 4 years ago

No, my email to the maintainer remained unanswered.

marioortizmanero commented 4 years ago

Should we do anything then? This has been inactive for 2 years. I'm not experienced enough to contribute myself but it'd be great to think about creating a new fork.

SpotlightKid commented 4 years ago

A fork happens if someone has the knowledge and the will to create and maintain it. I'm certainly not that person, since I'm neither an expert on D-Bus nor pygobject.

I'll continue using python-dbus.

poncovka commented 4 years ago

Hi, we are using a patched version of pydbus with some additional support for DBus objects. I am currently working on a complete replacement of pydbus in our project. Then we would like to take all that DBus related stuff and create a new library from it. The basic usage should be the same as with pydbus, but the extensibility should be much better. Unfortunately, a fork of pydbus will not help with that.

SpotlightKid commented 4 years ago

@poncovka That's good to hear. When you publish you project, it would be nice to leave a link here.

FelixSchwarz commented 4 years ago

Not sure if it helps but I'm using jeepney with good results together with a custom gevent-backend. Jeepney also has an asyncio backend and it is pretty easy to hook a custom "loop". Jeepney is also MIT licensed and the author was very responsive. Maybe worth another look?

poncovka commented 3 years ago

It's been a while since we've switched from pydbus to dasbus (https://github.com/rhinstaller/dasbus). The library is stable and well tested, so it could make other people happy. Here is a link to the main differences: https://dasbus.readthedocs.io/en/latest/pydbus.html