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, hash) ⇒ Object
- #enqueue_at(epoch_seconds, queue_name, klass, hash) ⇒ Object
-
#initialize ⇒ Base
constructor
adapters need to define the NonImplemented methods in this class.
- #redis ⇒ Object
- #setup_heartbeat! ⇒ Object
- #worker_included(base) ⇒ 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 |
# 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 raise NotImplementedError end |
#enqueue(queue_name, klass, hash) ⇒ Object
21 22 23 24 |
# File 'lib/queue_bus/adapters/base.rb', line 21 def enqueue(queue_name, klass, hash) # enqueue the given class (Driver/Rider) in your queue raise NotImplementedError end |
#enqueue_at(epoch_seconds, queue_name, klass, hash) ⇒ Object
26 27 28 29 |
# File 'lib/queue_bus/adapters/base.rb', line 26 def enqueue_at(epoch_seconds, queue_name, klass, hash) # enqueue the given class (Publisher) in your queue to run at given time raise NotImplementedError end |
#redis ⇒ Object
16 17 18 19 |
# File 'lib/queue_bus/adapters/base.rb', line 16 def redis # for now, we're always using redis as a storage mechanism so give us one raise NotImplementedError end |
#setup_heartbeat! ⇒ Object
31 32 33 34 |
# File 'lib/queue_bus/adapters/base.rb', line 31 def setup_heartbeat! # if possible, tell a recurring job system to publish every minute raise NotImplementedError end |
#worker_included(base) ⇒ Object
36 37 38 |
# File 'lib/queue_bus/adapters/base.rb', line 36 def worker_included(base) # optional method for including more modules in classes that work in the queue end |