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



8
9
10
# File 'lib/queue_bus/adapters/base.rb', line 8

def initialize
  enabled!
end

Instance Method Details

#enabled!Object

Raises:

  • (NotImplementedError)


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

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)


24
25
26
27
# File 'lib/queue_bus/adapters/base.rb', line 24

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)


29
30
31
32
# File 'lib/queue_bus/adapters/base.rb', line 29

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)


19
20
21
22
# File 'lib/queue_bus/adapters/base.rb', line 19

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)


34
35
36
37
# File 'lib/queue_bus/adapters/base.rb', line 34

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