[systemd-devel] sd-bus: "cancelling" async method call

Lennart Poettering lennart at poettering.net
Sun Apr 7 10:49:27 UTC 2019

On So, 07.04.19 00:50, Stanislav Angelovič (angelovic.s at gmail.com) wrote:

> Hi,
> Is there a way in sd-bus to "cancel" an async call issued through
> sd_bus_call_async() or sd_bus_call_method_async()? Under cancelling here I
> mean that the call issued can proceed to its end, but I'm just no more
> interested in results and don't want sd-bus to invoke provided callback
> when the reply comes.
> sd_bus_call_async() and sd_bus_call_method_async() functions provide
> sd_bus_slot* as an output argument, so if I applied sd_bus_slot_unref() on
> that slot ptr would sd-bus ignore the async call reply then? Or is there
> another way?

The async calls return an sd_bus_slot object. As long as there's a
reference to that the reply callback will be dispatched. hence, just
unref the slot fully and no callback will be invoked anymore.


Lennart Poettering, Berlin

More information about the systemd-devel mailing list