[systemd-devel] delayed reply to sd-bus method invocation
Lennart Poettering
lennart at poettering.net
Thu Jun 29 08:32:30 UTC 2017
On Wed, 28.06.17 20:52, Jason Litzinger (jlitzingerdev at gmail.com) wrote:
> I have a daemon using the sd-bus API with a use case that I suspect
> is supported, but wanted to see if there was an example anywhere (I've
> been looking, haven't found one yet).
>
> Is there a case in the systemd codebase (or something else) where a
> method is invoked but its handler doesn't immediately reply?
>
> What I'm trying to achieve is:
>
> * method called
> * Handler triggers some IO
> <time passes>
> * Important event occurs
> * Reply message sent to the caller
>
> I'm assuming this is possible/implemented, if not that would also be
> good to know :).
PID 1 does this when a Reload() operation is issued as it will then
seriliaze its state, flush the configuration out, load the new
configuration and read the state back in. But following the codepaths
for this isn#t trivial.
machined has easier-to-follow uses of this, as it does some operations
that might take a bit longer, such as cloning or removing images.
Lennart
--
Lennart Poettering, Red Hat
More information about the systemd-devel
mailing list