class Murcure::Pool(A, M, S)

Included Modules

Defined in:

murcure/utils/pool.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(capacity : Int32, agent_init_state : S) #

[View source]

Instance Method Detail

def call(message : M) #

[View source]
def call #

Spawns workers in their dedicated Fiber. Blocks until all workers have stopped.


[View source]
def terminate : Nil #

Asks each worker to stop.


[View source]
def trap(agent : A, exception : Exception | Nil) : Nil #

Recycles and restarts crashed and unexpectedly stopped agents.


[View source]