You will always have strict ordering of execution, but if you want to see the results in a strict order you must use the async call.
ben Sent from my phone. -----Original Message----- From: Stefan Groschupf <s...@101tec.com> Sent: Monday, August 03, 2009 10:38 PM To: email@example.com <firstname.lastname@example.org> Subject: Re: exist return true before event comes in Interesting, that basically means if I want strict order, I have to use the async api? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Hadoop training and consulting http://www.scaleunlimited.com http://www.101tec.com On Aug 3, 2009, at 8:10 PM, Benjamin Reed wrote: > 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 <zookeeper- > u...@hadoop.apache.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 > >