Std.Concurrent.Pool
7 public declarations
- pool
Int -> Int -> Result[Std.Concurrent.Pool.Pool, Std.Concurrent.ConcurrentError]A pool of
workersthreads over a queue holding at mostqueuejobs. - Pool
A fixed set of workers draining a bounded queue.
- queued
&Std.Concurrent.Pool.Pool -> Result[Int, Std.Concurrent.ConcurrentError]How many jobs are waiting for a worker.
- shutdown
&Std.Concurrent.Pool.Pool -> Result[(), Std.Concurrent.ConcurrentError]Refuse further jobs, run every queued one, and join every worker. Answers
- size
&Std.Concurrent.Pool.Pool -> IntHow many workers the pool runs.
- submit
&Std.Concurrent.Pool.Pool -> fn() -> () -> Result[(), Std.Concurrent.ConcurrentError]Queue a job, waiting while the queue is full. A crash in the job is
- submitFor
&Std.Concurrent.Pool.Pool -> fn() -> T -> Result[Std.Concurrent.Future.Future[T], Std.Concurrent.ConcurrentError]Queue a job and answer the future of its value; a crash settles the
