Class: Rosette::Queuing::Worker

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

Overview

Base class for Rosette queue worker implementations. Really just an interface.

Instance Method Summary collapse

Constructor Details

#initialize(rosette_config, logger, options = {}) ⇒ Worker

Creates a new worker instance. Options vary per implementation.

Parameters:

  • rosette_config (Configurator)

    The Rosette config to use.

  • logger (Logger)

    The logger to print messages with.

  • options (Hash) (defaults to: {})

    A hash of options used by the underlying queue implementation.


16
17
# File 'lib/rosette/queuing/worker.rb', line 16

def initialize(rosette_config, logger, options = {})
end

Instance Method Details

#startvoid

This method returns an undefined value.

Tells this worker to start processing jobs. Should block. If not implemented by the derived class, raises NotImplementedError.

Raises:

  • (NotImplementedError)

23
24
25
26
# File 'lib/rosette/queuing/worker.rb', line 23

def start
  raise NotImplementedError,
    'expected to be implemented in derived classes'
end