Class: QueueBus::Adapters::Data

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

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from QueueBus::Adapters::Base

Instance Method Details

#enabled!Object



5
6
7
# File 'lib/queue_bus/adapters/data.rb', line 5

def enabled!
  # nothing to do
end

#enqueue(queue_name, klass, json) ⇒ Object



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

def enqueue(queue_name, klass, json)
  push(queue_name, :class => klass.to_s, :args => [json])
end

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



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

def enqueue_at(epoch_seconds, queue_name, klass, json)
  item = delayed_job_to_hash_with_queue(queue_name, klass, [json])
  delayed_push(epoch_seconds, item)
end

#redis(&block) ⇒ Object



13
14
15
16
# File 'lib/queue_bus/adapters/data.rb', line 13

def redis(&block)
  raise "no redis instance set" unless @redis
  block.call(@redis)
end

#redis=(client) ⇒ Object



9
10
11
# File 'lib/queue_bus/adapters/data.rb', line 9

def redis=(client)
  @redis = client
end

#setup_heartbeat!(queue_name) ⇒ Object

Raises:

  • (NotImplementedError)


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

def setup_heartbeat!(queue_name)
  raise NotImplementedError
end