用法:
class distributed.Queue(name=None, client=None, maxsize=0)
分布式隊列
這允許多個客戶端通過multi-producer/multi-consumer 隊列在彼此之間共享期貨或少量數據。所有元數據都通過調度程序進行排序。
隊列的元素必須是 Futures 或 msgpack-encodable 數據(整數、字符串、列表、字典)。所有數據都通過調度程序發送,因此最好不要發送大對象。共享大對象分散數據並共享未來。
警告
這個對象是實驗性的
- name: string (optional):
其他客戶端和調度程序用來標識隊列的名稱。如果沒有給出,將生成一個隨機名稱。
- client: Client (optional):
用於與調度程序通信的客戶端。如果沒有給出,將使用默認的全局客戶端。
- maxsize: int (optional):
隊列中允許的項目數。如果為 0(默認值),則隊列大小無限製。
參數:
例子:
>>> from dask.distributed import Client, Queue >>> client = Client() >>> queue = Queue('x') >>> future = client.submit(f, x) >>> queue.put(future)
相關用法
- 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用法及代碼示例
- Python distributed.Client.start_ipython_scheduler用法及代碼示例
注:本文由純淨天空篩選整理自dask.org大神的英文原創作品 distributed.Queue。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。