zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mahadev Konar <maha...@hortonworks.com>
Subject Re: when to callback processResult
Date Tue, 12 Jul 2011 22:41:51 GMT
Hi Zhejiang,
  Asynccallback is the the call back that is called when your async call
to exists completes.

The watcher (process event) is called only when the watch event happens.
Like a node gets deleted in case of getChildren, a node data is updated.

I hope this clarifies it.

mahadev

On 7/11/11 10:30 PM, "朱晨杰" <zcj0429@gmail.com> wrote:

>Hi, everyone:
>   I'm new to zookeeper. I'm now reading through some demo and feel a
>little
>confused about the "Watcher". The code is:
>
>   zk.exists(znode, true, this, null);
>
>   so now I have two callback: *process(WatchedEvent event)* which is for
>Watcher and *processResult(int rc, String path, Object ctx, Stat stat)*
>which
>is for AsyncCallback.StatCallback. So I want to know what's the difference
>of these two callback and when they will be called? I can't find answers
>in
>API. Thanks!
>
>-- 
>Zhu Chenjie
>Zhejiang University, China



Mime
View raw message