You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by Maarten Koopmans <ma...@vrijheid.net> on 2009/11/23 18:15:58 UTC

legacy style watchers - or none at all

Hi,

I am coding away on yet another client interface, and I can live in a 
situation where I have no watchers. Callbacks into my interpreter are a 
bit risky as well, so I am opting for the legacy style now, wrapping the 
c interface in such a way that it never allows watchers on paths (and 
hence, callbacks).

My question is: "legacy style" watchers... legacy implies they'll go? I 
hope not, or if so, we can get the C watcherless (I am not sure how the 
C API would handle a void (empty char*) pointer for a callback). I like 
being able to set the boolean to false for legacy style watchers - it 
saves me a lot of trouble.

--Maarten

Re: legacy style watchers - or none at all

Posted by Patrick Hunt <ph...@apache.org>.
Maarten Koopmans wrote:
> I am coding away on yet another client interface, and I can live in a 
> situation where I have no watchers. Callbacks into my interpreter are a 
> bit risky as well, so I am opting for the legacy style now, wrapping the 
> c interface in such a way that it never allows watchers on paths (and 
> hence, callbacks).
> 
> My question is: "legacy style" watchers... legacy implies they'll go? I 
> hope not, or if so, we can get the C watcherless (I am not sure how the 
> C API would handle a void (empty char*) pointer for a callback). I like 
> being able to set the boolean to false for legacy style watchers - it 
> saves me a lot of trouble.

afaik that just means "the old method" - pre v3 of ZooKeeper we only had 
the global watcher, no "per operation" watches. Single watcher is nice 
for centralizing watch processing, "per operation" is invaluable for 
library developers (on top of zk). I don't think either method will go 
away - if you like enter a JIRA and we'll update the docs to make this 
more clear (ie remove "legacy" and the connotations it may imply)

Regards,

Patrick