當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


Python distributed.as_completed.next_batch用法及代碼示例

用法:

next_batch(block=True)

獲取下一批已完成的期貨。

參數

block布爾型,可選

如果為 True 則等到我們得到一些結果,否則立即返回,即使是一個空列表。默認為真。

返回

期貨或(未來,結果)元組列表

例子

>>> ac = as_completed(futures)  
>>> client.gather(ac.next_batch())  
[4, 1, 3]
>>> client.gather(ac.next_batch(block=False))  
[]

相關用法


注:本文由純淨天空篩選整理自dask.org大神的英文原創作品 distributed.as_completed.next_batch。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。