Class: QueueBus::Adapters::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/queue_bus/adapters/base.rb

Direct Known Subclasses

Data

Instance Method Summary collapse

Constructor Details

#initializeBase

adapters need to define the NonImplemented methods in this class



6
7
8
# File 'lib/queue_bus/adapters/base.rb', line 6

def initialize
  enabled!
end

Instance Method Details

#enabled!Object

Raises:

  • (NotImplementedError)


10
11
12
13
14
15
# File 'lib/queue_bus/adapters/base.rb', line 10

def enabled!
  # called the first time we know we are using this adapter
  # it would be a good spot to require the libraries you're using
  # and modify QueueBus::Worker as needed
  raise NotImplementedError
end

#enqueue(queue_name, klass, json) ⇒ Object

Raises:

  • (NotImplementedError)


22
23
24
25
# File 'lib/queue_bus/adapters/base.rb', line 22

def enqueue(queue_name, klass, json)
  # enqueue the given class (Driver/Rider) in your queue
  raise NotImplementedError
end

#enqueue_at(epoch_seconds, queue_name, klass, json) ⇒ Object

Raises:

  • (NotImplementedError)


27
28
29
30
# File 'lib/queue_bus/adapters/base.rb', line 27

def enqueue_at(epoch_seconds, queue_name, klass, json)
  # enqueue the given class (Publisher) in your queue to run at given time
  raise NotImplementedError
end

#redisObject

Raises:

  • (NotImplementedError)


17
18
19
20
# File 'lib/queue_bus/adapters/base.rb', line 17

def redis
  # for now, we're always using redis as a storage mechanism so give us one
  raise NotImplementedError
end

#setup_heartbeat!Object

Raises:

  • (NotImplementedError)


32
33
34
35
# File 'lib/queue_bus/adapters/base.rb', line 32

def setup_heartbeat!
  # if possible, tell a recurring job system to publish every minute
  raise NotImplementedError
end