def _find_get_func_for_client(client):
'''Return the "get" function corresponding to client'''
if client is None:
return get_sync
elif Executor and isinstance(client, Executor):
def get(*args, **kwargs):
pbar = ProgressBar()
pbar.register()
out = client.get(*args, **kwargs)
pbar.unregister()
return out
return get
elif isinstance(client, ThreadPool):
return dask_threaded_get
else:
raise ValueError('client argument not a thread pool dask scheduler or None')
评论列表
文章目录