语言

ExecutorCompletionService.PollAsync 方法

定义

重载

名称 说明
PollAsync()

运行 Poll() 到 Task。

PollAsync(Int64, TimeUnit)

运行 Poll(Int64, TimeUnit) 到 Task。

PollAsync()

运行 Poll() 到 Task。

public System.Threading.Tasks.Task<Java.Util.Concurrent.IFuture?> PollAsync();
member this.PollAsync : unit -> System.Threading.Tasks.Task<Java.Util.Concurrent.IFuture>

返回

一个任务,其结果为已完成的将来返回 Poll(),或者 null 当没有可用时返回。

注解

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于

PollAsync(Int64, TimeUnit)

运行 Poll(Int64, TimeUnit) 到 Task。

public System.Threading.Tasks.Task<Java.Util.Concurrent.IFuture?> PollAsync(long timeout, Java.Util.Concurrent.TimeUnit? unit);
member this.PollAsync : int64 * Java.Util.Concurrent.TimeUnit -> System.Threading.Tasks.Task<Java.Util.Concurrent.IFuture>

参数

timeout
Int64

传递到 Poll(Int64, TimeUnit)的最大等待持续时间。

unit
TimeUnit

用于度量 timeout的单位。

返回

一个任务,其结果为按时间 Poll(Int64, TimeUnit) 调用 null 或等待过期时返回的已完成未来。

注解

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于