Sha256: 453dc3f57c630fc3a9c382359ae94f1f4d97a00d74f945d0f0792d21756f0ad3

Contents?: true

Size: 890 Bytes

Versions: 1

Compression:

Stored size: 890 Bytes

Contents

# encoding: UTF-8

module Rosette
  module Queuing

    # Base class for Rosette queue worker implementations. Really just an
    # interface.
    class Worker
      # Creates a new worker instance. Options vary per implementation.
      #
      # @param [Configurator] rosette_config The Rosette config to use.
      # @param [Logger] logger The logger to print messages with.
      # @param [Hash] options A hash of options used by the underlying
      #   queue implementation.
      # @return [Worker]
      def initialize(rosette_config, logger, options = {})
      end

      # Tells this worker to start processing jobs. Should block. If not
      # implemented by the derived class, raises +NotImplementedError+.
      #
      # @return [void]
      def start
        raise NotImplementedError,
          'expected to be implemented in derived classes'
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rosette-core-1.0.1 lib/rosette/queuing/worker.rb