I have 2 modules, i am ordering the configuration in a single transaction by using the priority in the during confd_subscribe2() so that i get config change notifications for module a first and then module b as they have dependency.
The above works fine during a create/set, but on a delete i want it the other way, module b first and then module a. As i have ordered priority the module a will be called first again, which is what i want the other way around.
Is there any way to order the config change notification as given by the user ?
Both my modules are subscribed for config change notif from the same deamon.
Hi,
You can for example have our module a subscriber first check for deletes in module b. Something similar is done in the examples.confd/cdb_subscription/trigger example. See README and cdb_client_B.c for inspiration.
The cdb_subscription/trigger example tries to show many things:-), the essence of the logic for this case may be difficult to identify there. The basic idea for the module a/b case is:
Then when subid1 is triggered, process only create/set, when subid2 is triggered process all changes, and when subid3 is triggered, process only delete. This way create/set will be processed for module a before module b, while delete will be processed for module b before module a.