Information request

Tako Schotanus quintesse at palacio-cristal.com
Thu Apr 13 02:27:24 PDT 2006


Matthew Johnson wrote:

>On Wed, 12 Apr 2006, Thiago Macieira wrote:
>
>  
>
>>>Is it possible for C to do a method call to method "i SomeMethod(i,s)"
>>>to all objects implementing the "org.foo.SomeIface" interface, and
>>>getting replies from all these objects?
>>>      
>>>
>>Not automatically.
>>
>>It could do a bus-search and find all objects in all services that
>>implement that interface, but not only would that be inefficient, it is
>>also not atomic (services could connect and disconnect at any time).
>>
>>    
>>
>You could have A and B reply to a signal from C by calling a method on C
>telling C that they provide org.foo.SomeIface and it can then iterate
>over them.
>
>so you would have
>
>C->* signal
>B->C register
>A->C register
>C->A call method
>C->B call method
>
>the register could be a signal or a method call, depending on how many
>other clients like C there are. A & B could send out a register signal
>when they start, periodically and when requested. All clients could
>watch for these signals and add them to a list to iterate over when they
>want to call the methods.
>
>  
>
The bad thing about this though is that all those aplications need to 
implement your interface which might not be realistic.
They might all implement a specific interface because maybe it's a 
standard (like all IMs implementing .org.freedesktop.IMessenger or 
something) but getting them to implement your IReallyCoolIdea might take 
some convincing. So IMO there are definitely usecases where it would be 
nice if foreach (service impelmenting IMessenger) {} could work.

Cheers,
 -Tako



More information about the dbus mailing list