Services calling back to clients

Havoc Pennington hp at redhat.com
Tue Jun 21 18:40:43 PDT 2005


Random crazy talk -

I think this case, David E's solution, and the video stream thing David
Z mentioned, could maybe be lumped into a pattern like this:

server->register (client)
...
client->dostuff ()
client->dostuff ()

server->unregister (client)


this pattern is basically useful when we need to send each client
different data (vs. signals where the event has fixed data which is the
same for everyone interested).

One approach to this might be Anders' signal detail feature, used as
follows:

 bus->AddMatch (sender='server bus name',detail='random string')
 server->register ('random string');

 server emits signals with detail 'random string'

 server->unregister ('random string');

Essentially this creates a stream of signals (with arbitrary data args)
that is unique to the client inventing the random string.

The server still needs to know which client sent the random string and
auto-unregister if that client vanishes, though.

A stream primitive might take this idea and automate some of the details
in the bus, e.g. automatically creating the random strings and notifying
the server when the client owning them vanishes. Client and server would
have to implement some stream-related methods basically which the bus
would automatically invoke at the right time.

It's kind of a mess but I guess it could be convenient. Someone clean up
the idea ;-)

Havoc


 



More information about the dbus mailing list