Order of configurations in a transaction


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.

module a{}
module b {}

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:

cdb_subscribe(s, 100, 0, &subid1, module_a_path);
cdb_subscribe(s, 200, 0, &subid2, module_b_path);
cdb_subscribe(s, 300, 0, &subid3, module_a_path);

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.

Thanks per, will try this out.