用法:
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。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。