call for advice (is dbus ok for me ?)

Avery Pennarun apenwarr at gmail.com
Mon Sep 15 11:06:35 PDT 2008


On Mon, Sep 15, 2008 at 1:17 AM, sfora dim <sfora.dim at gmail.com> wrote:
> On Sun, Sep 14, 2008 at 8:19 PM, Thiago Macieira <thiago at kde.org> wrote:
>> Even if the daemon doesn't reject the second reply, the library will have
>> discarded the information on your callback after the first reply came.
>
> Why is that ?
>
> It can be quite helpful actually to be able to send multiple replies
> to the same method call.

It would indeed be helpful, but it leads to a difficult design
problem.  When sending a reply, all the dbus-daemon receives is the
message number that you're replying to.  It has to use that message
number to decide who to send the reply back to.

So the dbus-daemon keeps a list of messages that have not yet received
a reply.  If it didn't expire things from that list after processing a
reply, the list would just keep growing forever.

It's pretty easy to register a DBus signal for this sort of thing.
Not quite as elegant as a "reply but this isn't the last reply yet, I
promise!" message type, but it wins because there's no such thing as
the latter :)

Have fun,

Avery


More information about the dbus mailing list