public function cancelWatch($path, $callback = null)
{
if (isset($this->callback[$path])) {
if (empty($callback)) {
unset($this->callback[$path]);
$this->zookeeper->get($path);
//reset the callback
return true;
} else {
$key = array_search($callback, $this->callback[$path]);
if ($key !== false) {
unset($this->callback[$path][$key]);
return true;
} else {
return null;
}
}
} else {
return null;
}
}