pydbus icon indicating copy to clipboard operation
pydbus copied to clipboard

Support asynchronous calls (#58)

Open poncovka opened this issue 7 years ago • 17 comments

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))

poncovka avatar Jul 28 '17 14:07 poncovka

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

jkonecny12 avatar Aug 18 '17 14:08 jkonecny12

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!

johan-bjareholt avatar May 04 '18 06:05 johan-bjareholt

@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 :(.

jkonecny12 avatar May 04 '18 07:05 jkonecny12

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

johan-bjareholt avatar May 04 '18 13:05 johan-bjareholt

@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

M4rtinK avatar May 04 '18 13:05 M4rtinK

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 avatar Mar 30 '19 19:03 SpotlightKid

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.

SpotlightKid avatar Aug 01 '19 20:08 SpotlightKid

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

marioortizmanero avatar Aug 18 '19 20:08 marioortizmanero

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

SpotlightKid avatar Aug 18 '19 20:08 SpotlightKid

Any news?

marioortizmanero avatar Sep 27 '19 07:09 marioortizmanero

No, my email to the maintainer remained unanswered.

SpotlightKid avatar Sep 27 '19 09:09 SpotlightKid

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.

marioortizmanero avatar Sep 27 '19 10:09 marioortizmanero

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.

SpotlightKid avatar Sep 27 '19 11:09 SpotlightKid

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.

poncovka avatar Sep 27 '19 14:09 poncovka

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

SpotlightKid avatar Sep 27 '19 16:09 SpotlightKid

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?

FelixSchwarz avatar Sep 27 '19 17:09 FelixSchwarz

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

poncovka avatar Aug 10 '20 09:08 poncovka