Class: Fractor::Worker

Inherits:
Object
  • Object
show all
Defined in:
lib/fractor/worker.rb

Overview

Base class for defining work processors. Subclasses must implement the ‘process` method.

Instance Method Summary collapse

Constructor Details

#initialize(name: nil, **options) ⇒ Worker

Returns a new instance of Worker.



7
8
9
10
# File 'lib/fractor/worker.rb', line 7

def initialize(name: nil, **options)
  @name = name
  @options = options
end

Instance Method Details

#process(work) ⇒ Object

Raises:

  • (NotImplementedError)


12
13
14
15
# File 'lib/fractor/worker.rb', line 12

def process(work)
  raise NotImplementedError,
        "Subclasses must implement the 'process' method."
end