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
8 9 10 |
# File 'lib/queue_bus/adapters/base.rb', line 8 def initialize enabled! end |
Instance Method Details
#enabled! ⇒ Object
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
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
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 |
#redis ⇒ Object
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
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 |