async def delete(self, path, force=False): path = self.normalize_path(path) if not force and path in self.stat_cache: version = self.stat_cache[path].version else: version = -1 await self.send(protocol.DeleteRequest(path=path, version=version))
def delete(self, path, version=-1): """ Delete znode :param str path: Znode path :param int version: Current version of node :return: None """ path = self.client.normalize_path(path) self.request.add(protocol.DeleteRequest(path=path, version=version))
async def delete(self, path, force=False): """ Delete a znode at the path. :param str path: Path of znode :param bool force: True for ignoring version of the znode. A version of a znode is used as an optimistic lock mechanism. Set false for making use of a version that is tracked by a stat cache of ZKClient. :raises aiozk.exc.NoNode: Raised if path does not exist. """ path = self.normalize_path(path) if not force and path in self.stat_cache: version = self.stat_cache[path].version else: version = -1 await self.send(protocol.DeleteRequest(path=path, version=version))
def delete(self, path, version=-1): path = self.client.normalize_path(path) self.request.add(protocol.DeleteRequest(path=path, version=version))