class WorkerPool

Defined in:

worker_pool.cr

Constant Summary

Log = ::Log.for(self)
VERSION = "1.0.0"

Constructors

Instance Method Summary

Constructor Detail

def self.new(size : Int32, same_thread : Bool = true, tracking : Bool = true) #

[View source]

Instance Method Detail

def available : Int32 #

number of fibers currently available


[View source]
def finalize #

ensure the fibers complete if the pool goes out of scope


[View source]
def perform(&block : Proc(Nil)) #

perform a task using the pool


[View source]
def running? #

is the fiber pool running


[View source]
def same_thread? : Bool #

are fibers all running on the same thread?


[View source]
def size : Int32 #

number of fibers in the pool


[View source]
def stop #

blocks until all the fibers complete if tracking


[View source]
def tracking? : Bool #

are we tracking fiber usage


[View source]
def would_block? #

is there an available fiber or would we block waiting for a fiber


[View source]