Class: ActiveHook::Server::Queue

Inherits:
Object
  • Object
show all
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

Constructor Details

#initializeQueue

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

#shutdownObject

Shutsdown our queue process.



22
23
24
# File 'lib/activehook/server/queue.rb', line 22

def shutdown
  @done = true
end

#startObject

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