Closed zeenix closed 1 year ago
@DataTriny I'm currently on vacation. I'll reply when I'm back later this week.
maintain two copies of the tree (one
ObjectServer
for eachConnection
: I don't think this is a good idea as the tree can get pretty big,
Are you certain that size of the tree is very relevant here? As long as you don't duplicate a lot of state (for which you can use Arc
etc) between them, your code's memory usage should be pretty minimum. ObjectServer
OTOH uses allocated strings for object paths though (not interfaces though) so that will have an impact but I'd check if it's large enough in your case to worry about.
handle message dispatching on my own: this would be possible but rather hard I guess.
If the ObjectServer
duplication isn't an option for you, I'm afraid this is the only alternative you're left with. You'll need to use the low-level (Connection
) API instead. It might feel like a lot of work but for such special use cases, I think it's not too bad but that's just my opinion. :)
My question then is: is handling this situation part of the plans for
zbus
?
We don't have any plans for such cases but if you've suggestion on how we can support that, please feel free to suggest.
@DataTriny ping?
In GitLab by @danieldg on Aug 3, 2021, 02:30
Note that if you ever want to expose any differences between the two buses, you'll need to split the ObjectServer anyway - and I suspect you will eventually want to do that. You can still use Arc as suggested to share the large (common) parts of the tree.
@DataTriny ObjectServer
is now Sync+Send in the main branch btw.
In GitLab by @DataTriny on Jul 17, 2021, 13:28
Hello,
I am trying to build a D-Bus server application that connects to a private bus (let's call it
A
). For performance reasons, one of the interfaces I need to implement must expose a method (let's call itGetBusAddress
) that return the address of another private bus I should create myself (let's call it busB
).A typical workflow look like this:
A
and exposes a bunch of objects,A
detects my server and makes a call toGetBusAddress
,B
if it is not already, and returns its address to the client,B
.The problem here is that my server must expose the whole object tree on both buses. The only solutions I see around this are:
ObjectServer
for eachConnection
: I don't think this is a good idea as the tree can get pretty big,My question then is: is handling this situation part of the plans for
zbus
?Thanks in advance.
Kind regards,