[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-442?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12718898#action_12718898
 ] 

Patrick Hunt commented on ZOOKEEPER-442:
----------------------------------------

this is a comment I made on the mailing list:

We probably want to allow the caller to specify which type of watch they want 
to remove - a watch on the znode itself, on children of the znode, or both.

zk.removeWatch(path, watcher, wtype)
where:
path is path to the znode
watcher may be a specific watcher or null matching all watchers
wtype is enum of TYPE_CHILD, TYPE_DATA, or TYPE_ALL (something like that)

We also need to be careful of the semantics since "watch" wraps up a couple of 
concepts: the trigger and the notification. What are we removing? The trigger 
or both? If just the trigger then you may still be notified after removeWatch 
is called (if notification is "in flight"). Perhaps removal of the watch should 
itself trigger the notification to all watchers, with a new notification type 
of "watch removed"? 

> need a way to remove watches that are no longer of interest
> -----------------------------------------------------------
>
>                 Key: ZOOKEEPER-442
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-442
>             Project: Zookeeper
>          Issue Type: Improvement
>            Reporter: Benjamin Reed
>
> currently the only way a watch cleared is to trigger it. we need a way to 
> enumerate the outstanding watch objects, find watch events the objects are 
> watching for, and remove interests in an event.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to