class
RemiLib::JobPool(T)
- RemiLib::JobPool(T)
- Reference
- Object
Overview
A JobPool allows you to perform work on an enumerable set of things,
spreading the work out over a set of fibers.
Defined in:
remilib/concurrency.crConstructors
-
.new(name : String | Nil = nil)
Creates a new
JobPoolwith the number of workers equal to the number of logical CPUs in the system. -
.new(workers : Int32, name : String | Nil = nil)
Creates a new
JobPoolwith the given number of workers.
Instance Method Summary
-
#errors : Array(Exception)
Holds the errors that occurred during
#run. -
#run(things : Enumerable, &block : T -> Nil)
Runs the pool, assigning one element of
thingsto each job. -
#workers : Int32
The maximum number of jobs that this
JobPoolcan handle.
Instance methods inherited from class Object
toRsconf(io : IO, *, indentSize : Int = 2, alwaysQuoteKeys : Bool = false, explicitRootObject : Bool = false, commaAfterValues : Bool = false, extraNewlineBetweenToplevelKeys : Bool = false) : NiltoRsconf(*, indentSize : Int = 2, alwaysQuoteKeys : Bool = false, explicitRootObject : Bool = false, commaAfterValues : Bool = false, extraNewlineBetweenToplevelKeys : Bool = false) : String toRsconf
Class methods inherited from class Object
fromRsconf(toplevel : RemiLib::RSConf::RSValue)fromRsconf(data : String | IO | Path) fromRsconf
Constructor Detail
Creates a new JobPool with the number of workers equal to the number of
logical CPUs in the system.
Creates a new JobPool with the given number of workers. This must be
greater than zero.