-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add D-Bus signal APIs #11
Comments
The proxy interfaces of the library already allow you to attach a callback to a signal and then remove that listener later using |
We are using the low-level APIs, not the high-level APIs. And even if we were using proxies, they suffer from a race condition where you can't subscribe to the signals until after the object is created and so you end up having to call "GetManagedObjects" twice. Additional motivation: altdesktop/python-dbus-next#53 |
Interesting, didn't know that. In supervisor we currently use the low-level APIs for signal listening as well but for a different reason. Currently in supervisor the only time we listen for signals is for confirmation of an asynchronous action. Like when changing the active connection in network manager we then listen for the StateChanged signal to confirm it worked. Similar when installing a rauc bundle file it fires the Installer.Completed signal when done. So we can't use the async with proxy.with_signal() as signal:
proxy.call_start_something_async()
resp = await signal.wait_for_signal() I was also planning to enhance supervisor with the ability to continuously listen for PropertiesChanged events on the objects it cares about. I had been planning to use the high-level client for this but I guess I'll have to review this now. |
In Bleak, we have some code that is a nice wrapper around
org.freedesktop.DBus.AddMatch
andorg.freedesktop.DBus.RemoveMatch
that would be nice to include in this package to make subscribing to signals in the low-level API easier.https://github.com/hbldh/bleak/blob/develop/bleak/backends/bluezdbus/signals.py
The text was updated successfully, but these errors were encountered: