class ThreadPoolScheduler
ErrorsCollection

class ThreadPoolScheduler

Scheduler that distributes work among a pool of threads

class ThreadPoolScheduler does Scheduler {}

The ThreadPoolScheduler has a range of number of threads that it maintains, and it distributes work among those threads. When the upper limit of threads isn't reached yet, and there is work pending, it spawns new threads to handle the work.

Methods

new

method new(Int :$initial_threads = 0Int :$max_threads=16)

Creates a new ThreadPoolScheduler object with the given range of threads to maintain.