Class: ActiveHook::Server::Queue
- Inherits:
-
Object
- Object
- ActiveHook::Server::Queue
- Defined in:
- lib/activehook/server/queue.rb
Overview
The Queue object processes any hooks that are queued into our Redis server. It will perform a ‘blocking pop’ on our hook list until one is added.
Instance Method Summary collapse
-
#initialize ⇒ Queue
constructor
A new instance of Queue.
-
#shutdown ⇒ Object
Shutsdown our queue process.
-
#start ⇒ Object
Starts our queue process.
Constructor Details
#initialize ⇒ Queue
Returns a new instance of Queue.
7 8 9 |
# File 'lib/activehook/server/queue.rb', line 7 def initialize @done = false end |
Instance Method Details
#shutdown ⇒ Object
Shutsdown our queue process.
22 23 24 |
# File 'lib/activehook/server/queue.rb', line 22 def shutdown @done = true end |
#start ⇒ Object
Starts our queue process. This will run until instructed to stop.
13 14 15 16 17 18 |
# File 'lib/activehook/server/queue.rb', line 13 def start until @done json = retrieve_hook HookRunner.new(json) if json end end |