class

WorkerPool::Worker(A)

Inherits Reference < Object

This class defines a simple forever-running Worker. The implementations of this abstract class will only have to define the process and on_error methods to have a simple but robust Worker

Constants

Log = ::Log.for(self)

Constructors

new(channel : Channel(A), id : Int32)
Source

Instance methods

on_error(error)

This method will get called whenever an error raises when processing a new workload

Source
process(workload : A)

This method will get called each time the worker processes a new workload

Source
start

Starts a new workload consumer that will be kept alive as long as the channel is open

Source