用法:
class distributed.Future(key, client=None, inform=True, state=None)
远程运行的计算
Future 是在远程工作人员上运行的结果的本地代理。用户管理本地 Python 进程中的未来对象,以确定更大集群中发生的情况。
- key: str, or tuple:
这个未来所指的远程数据的 key
- client: Client:
应该拥有这个未来的客户。默认为_get_global_client()
- inform: bool:
我们是否通知调度程序我们需要关于这个未来的更新
- state: FutureState:
未来的状态
参数:
例子:
期货通常来自客户端计算
>>> my_future = client.submit(add, 1, 2)
我们可以跟踪未来的进展和结果
>>> my_future <Future: status: finished, key: add-8f6e709446674bad78ea8aeecfee188e>
我们可以从未来获取结果或异常和回溯
>>> my_future.result()
相关用法
- Python distributed.Future.traceback用法及代码示例
- Python distributed.protocol.serialize.register_generic用法及代码示例
- Python distributed.Client.gather用法及代码示例
- Python distributed.recreate_tasks.ReplayTaskClient.recreate_task_locally用法及代码示例
- Python distributed.diagnostics.plugin.SchedulerPlugin用法及代码示例
- Python distributed.Client.ncores用法及代码示例
- Python distributed.Client.retire_workers用法及代码示例
- Python distributed.Client.unregister_worker_plugin用法及代码示例
- Python distributed.fire_and_forget用法及代码示例
- Python distributed.Client.set_metadata用法及代码示例
- Python distributed.Client.scheduler_info用法及代码示例
- Python distributed.Client.submit用法及代码示例
- Python distributed.Client.compute用法及代码示例
- Python distributed.SpecCluster.scale用法及代码示例
- Python distributed.get_worker用法及代码示例
- Python distributed.SpecCluster.scale_up用法及代码示例
- Python distributed.Client.nthreads用法及代码示例
- Python distributed.comm.resolve_address用法及代码示例
- Python distributed.Client.unpublish_dataset用法及代码示例
- Python distributed.get_task_stream用法及代码示例
注:本文由纯净天空筛选整理自dask.org大神的英文原创作品 distributed.Future。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。