Beispiel #1
0
 def __init__(self,
              gcs_project=None,
              fs=None,
              deploy_config=None,
              session=None,
              headers=None,
              _token=None):
     self._client = MemoryClient(gcs_project, fs, deploy_config, session,
                                 headers, _token)
     async_to_blocking(self._client.async_init())
Beispiel #2
0
class BlockingMemoryClient:
    def __init__(self, gcs_project=None, fs=None, deploy_config=None, session=None, headers=None, _token=None):
        self._client = MemoryClient(gcs_project, fs, deploy_config, session, headers, _token)
        async_to_blocking(self._client.async_init())

    def _get_file_if_exists(self, filename):
        return async_to_blocking(self._client._get_file_if_exists(filename))

    def read_file(self, filename):
        return async_to_blocking(self._client.read_file(filename))

    def write_file(self, filename, data):
        return async_to_blocking(self._client.write_file(filename, data))

    def close(self):
        return async_to_blocking(self._client.close())