class ActiveHook::Server::Queue
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.
Public Class Methods
new()
click to toggle source
# File lib/activehook/server/queue.rb, line 7 def initialize @done = false end
Public Instance Methods
shutdown()
click to toggle source
Shutsdown our queue process.
# File lib/activehook/server/queue.rb, line 22 def shutdown @done = true end
start()
click to toggle source
Starts our queue process. This will run until instructed to stop.
# File lib/activehook/server/queue.rb, line 13 def start until @done json = retrieve_hook HookRunner.new(json) if json end end
Private Instance Methods
retrieve_hook()
click to toggle source
Performs a 'blocking pop' on our redis queue list.
# File lib/activehook/server/queue.rb, line 30 def retrieve_hook json = ActiveHook.redis.with { |c| c.brpop('ah:queue') } json.last if json end