2018-11-02 07:12:19 UTC
I have a question regarding manipulating sd-bus paths during run time.
Let us assume the calculator example from:
We host the object /net/poettering/Calculator through
I am looking for ways to add/remove objects to the service after the
process has started.
Say adding objects: /net/poettering/ScientificCalculator ,
One approach I could think of is:
- Stop the infinite loop
- Unref the bus and slot
- Call required number of sd_bus_add_object_vtable objects (3 in this case)
- Request a well known name and restart the infinite loop.
Is this the right way?
Can someone please help with any design patterns, references or pointers on
how we could achieve this?
Another approach (Crude but not the desired way):
- Take the number of bus paths from a config file
- Change config file and restart the process (systemctl restart