Module ExecutorCompletionService

module ExecutorCompletionService: sig .. end
Helper entities for thread pool executors.

type t 
The type of completion services, providing utilities to wait for future completions.
val make : ThreadPoolExecutor.t -> t
Returns a new completion service based on the passed thread pool.
val poll : t -> 'a Future.t option
Returns (and removes from the service) a completed task if any, or returns None.
val poll_time : t -> int64 -> TimeUnit.t -> 'a Future.t option
poll_time s t u is similar to pool s, except that the current thread will at most wait for t (time value whose unit is u).

Raises Runtime.Interrupted if the thread is interrupted.

val submit : t -> ('a -> 'b) -> 'a -> 'b Future.t
Same as ThreadPoolExecutor.submit.
val take : t -> 'a Future.t
Waits for a task to complete, and returns it.

Raises Runtime.Interrupted if the thread is interrupted.