Closed mistergibson closed 1 year ago
Also - how do I 'un-export' a service when I'm done with it (other than exiting the process)?
Hi!
Regarding exporting multiple services: I think you can achieve this by instantiating multiple Connection
s, specifically ASystemBus
es or ASessionBus
es. But I have never tried this so it is possible that something breaks it.
Regarding unexporting a service, it is possible in a crude way by calling ReleaseName
, see the file server_spec.rb
for an example.
Fixed in #135, released 0.23.0.beta1
I'm not sure if I got your question right but I will repurpose this report for my current problem:
A connection can have more than one well-known name (the letter-dotted one), ruby-dbus doesn't support it.
For example on my desktop I have one connection using 3 well-known names:
This is persumably to offer a custom Thunar interface as well as a common FileManager interface.
Another use case is to implement multiple loosely related services in the same process to save on memory overhead (like Agama Manager+Users).
Currently ruby-dbus cannot do this, it assumes that your service has exactly one well-known name and you call:
Even if you try to trick the library requesting 2 "services" and exporting the objects on the latter one which gets remembered internally:
It will kind of work, eventually producing the object tree what you want, but importantly for autostarted services, the second
request_service
call will already start processing method calls for the objects that haven't been exported yet. So the first method call will fail.Original report: