Class: QueueBus::Adapters::Base
- Inherits:
-
Object
- Object
- QueueBus::Adapters::Base
- Defined in:
- lib/queue_bus/adapters/base.rb
Direct Known Subclasses
Instance Method Summary collapse
- #enabled! ⇒ Object
- #enqueue(queue_name, klass, json) ⇒ Object
- #enqueue_at(epoch_seconds, queue_name, klass, json) ⇒ Object
-
#initialize ⇒ Base
constructor
adapters need to define the NonImplemented methods in this class.
- #redis ⇒ Object
- #setup_heartbeat! ⇒ Object
Constructor Details
#initialize ⇒ Base
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
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
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
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 |
#redis ⇒ Object
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
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 |