[systemd-devel] Async server with sd-bus

Stanislav Angelovič angelovic.s at gmail.com
Mon May 21 06:37:37 UTC 2018


Hi folks,

Suppose we have a server whose methods may take relatively long time and I
would like to process them asynchronously within the server, so while a
client is waiting for reply to his time-consuming call, other clients
(which could be served quickly, for example) are not starved because of
this.

I suppose sd-bus supports such an approach, since it is message-based.

Also, implementation-wise, I suppose these async replies must be sent back
by the processing thread that handles requests upon the bus connection
(since sd_bus and sd_bus_message seem to no be thread-safe). So I need to
sent the reply messages from the worker thread back to the processing
thread, to send them out.

I am right with my assumptions and statements? Have you already solved such
a problem somewhere in systemd?

Thanks for help and cheers!

Stanislav.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20180521/443ba328/attachment.html>


More information about the systemd-devel mailing list