[systemd-devel] sd-bus delayed reply

Jean Valjean valjean.jean1802 at gmail.com
Mon Jan 28 10:25:48 UTC 2019


Is there a possibility to send a delayed response to a method call?
The scenario is
1. Message A with input data is received by a service and placed into
a list. This message will be used to reply later.
2. A routine is invoked that might take a long time to prepare a reply
on a background thread
3. While reply is being prepared service can still receive and process
new incoming messages B, C, D and send replies to them
4. Once routine is done A is taken from the list and used to send a reply.

I know that it is possible to use sd_bus_process to get and process
incoming messages.
But in that case I wonder how do I add an object so that it is visible
in the tree produced by
busctl --user tree org.example
I can't use sd_bus_add_object or sd_bus_add_object_vtable because If I
execute the routine in handlers then
it will block the service from receiving other messages.

Boris


More information about the systemd-devel mailing list