コード例 #1
0
ファイル: client.py プロジェクト: hire-us/aiozk-backup
    async def get_data(self, path, watch=False):
        path = self.normalize_path(path)

        response = await self.send(
            protocol.GetDataRequest(path=path, watch=watch)
        )
        return response.data
コード例 #2
0
ファイル: client.py プロジェクト: rhdxmr/aiozk
    async def get(self, path, watch=False):
        """
        Get data as bytes and stat of znode.

        :param str path: Path of znode

        :param bool watch: True for setting a watch event as a side effect,
            otherwise False

        :return: Data and stat of znode
        :rtype: (bytes, aiozk.protocol.stat.Stat)

        :raises aiozk.exc.NoNode: Can be raised if path does not exist
        """
        # type: (str, bool) -> Tuple[str, protocol.stat.Stat]
        path = self.normalize_path(path)
        response = await self.send(
            protocol.GetDataRequest(path=path, watch=watch))

        return (response.data, response.stat)
コード例 #3
0
ファイル: client.py プロジェクト: packysauce/aiozk
 async def get(self, path, watch=False):
     # type: (str, bool) -> Tuple[str, protocol.stat.Stat]
     path = self.normalize_path(path)
     response = await self.send(protocol.GetDataRequest(path=path, watch=watch))
     return (response.data, response.stat)