I assume you are calling the synchronous version of exists. The callbacks for both the watches and async calls are processed by a callback thread, so the ordering is strict. Synchronous call responses are not queued to the callback thread. (this allows you to make synchronous calls in callbacks without deadlocking.) thus the effect you are seeing may be due to a backed up callback queue and/or thread scheduling.
ben Sent from my phone. -----Original Message----- From: Stefan Groschupf <s...@101tec.com> Sent: Monday, August 03, 2009 9:31 PM To: email@example.com <firstname.lastname@example.org> Subject: exist return true before event comes in Hi, I'm running into following problem writing a fasade for Zk Client (http://github.com/joa23/zkclient/ ) 1.) Subscribe a watch via exist(path, true) for a path. 2.) Create a persistent node. 3.) Call exist and it returns true 4.) Zookeeper sends a NodeCreated event. I would expect that the client would get the NodeCreated event before exist returns true. Does anyone has a idea of a pattern that secures that exist return false, before the event is triggered? Thanks, Stefan