Class: Rosette::Queuing::Queue

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

Overview

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

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Queue

Creates a new queue instance. Options vary per implementation.

Parameters:

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

    A hash of options used by the underlying queue implementation.


13
14
# File 'lib/rosette/queuing/queue.rb', line 13

def initialize(options = {})
end

Instance Method Details

#enqueue(job) ⇒ void

This method returns an undefined value.

Add a job instance to the queue. If not implemented by a derived class, raises NotImplementedError.

Parameters:

  • job (Job)

    The job to enqueue.

Raises:

  • (NotImplementedError)

21
22
23
24
# File 'lib/rosette/queuing/queue.rb', line 21

def enqueue(job)
  raise NotImplementedError,
    'expected to be implemented in derived classes'
end