Hi All,

I am new to zookeeper/ curator.

I want to setup watch on node if number of children is greater than zero.

I can check number of children before setting the watch.
But there could be a race condition in which , number of children of the
node went to zero before setting up the watch and after checking for number
of children.
And this could lead to deadlock, because i will be listening for child
removal event and there will be none.

One way i could think of solving is polling for number of children in
separate thread.
But is there any cleaner approach via which i can avoid polling ?

Thanks,
Giridhar.

Reply via email to