If so, how to reply to these find_next() callbacks? Especially when the list with lots of items and performance need to be considered. Is there a general way to handle this?
If performance is of concern, I suggest you focus on the get_elem()/get_next() calls that occur for each list entry, and not the first two find_next() (that will not be called for each list entry) when you show the data from the CLI.
To avoid get_elem()/get_next() calls for each list entry you can also implement find_next_object(). In addition, find_next_object() will be the only callback called and will only be called once for the use case you describe here. See https://github.com/ConfD-Developer/ConfD-Demos/tree/master/dp-performance for a demo.
I did some test on find_next_object() callbacks. it’s same as find_next(), being called twice. In my code, confd_data_reply_next_object_tag_value_arrays() is used to reply each find_next_object() callback including all list items and an end-of-list indication. These two callbacks contains different traversal_id.
Yes, they will be called twice.
However, there will be no get_elem()/get_next() calls if you skip registering them as the demo I pointed you to show.
There is no need for keeping track of any traversal id if you skip get_next() and register find_next() + find_next_object() only as the demo show as well.