Sha256: 962bbf999b94402614162213e068c0acc0cf626744b368c0f952a57b3a3dcb1d

Contents?: true

Size: 737 Bytes

Versions: 1

Compression:

Stored size: 737 Bytes

Contents

# encoding: UTF-8

module Rosette
  module Queuing

    # Base class for Rosette queue implementations. Really just an interface.
    class Queue
      # Creates a new queue instance. Options vary per implementation.
      #
      # @param [Hash] options A hash of options used by the underlying
      #   queue implementation.
      # @return [Queue]
      def initialize(options = {})
      end

      # Add a job instance to the queue. If not implemented by a derived class,
      # raises +NotImplementedError+.
      #
      # @param [Job] job The job to enqueue.
      # @return [void]
      def enqueue(job)
        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/queue.rb