Commit 976841a0 authored by John E. Vincent's avatar John E. Vincent

fixing examples with new watcher pattern syntax

parent 4e75f4ba
......@@ -21,7 +21,7 @@ Essentially the idea is that you tap into the Redis subscription with a defined
require './watcher-idea.rb'
Noah::Watcher.watch do
pattern "noah.Configuration"
pattern "//noah/configuration/*"
destination Proc.new {|x| something_with(x)}
run!
end
......
......@@ -6,7 +6,7 @@ require 'excon'
class HttpPostWatch < Noah::Watcher
redis_host "redis://127.0.0.1:6379/1"
pattern "noah.configuration.*"
pattern "//noah/configuration/*"
destination Proc.new {|x| ::Excon.post("http://localhost:4567/webhook", :headers => {"Content-Type" => "application/json"}, :body => x)}
run!
end
......@@ -5,7 +5,7 @@ require 'logger'
class LoggingWatcher < Noah::Watcher
redis_host "redis://127.0.0.1:6379/5"
pattern "noah.application.*"
pattern "//noah/application/*"
destination Proc.new {|x| log = Logger.new(STDOUT); log.debug(x)}
run!
end
......@@ -5,7 +5,7 @@ require 'excon'
class HttpPostWatch < Noah::Watcher
redis_host "redis://127.0.0.1:6379/0"
pattern "noah.configuration.redis_server.update"
pattern "//noah/configuration/redis_server.update"
destination Proc.new {|x| puts x; ::Excon.put("http://localhost:4567/webhook", :headers => {"Content-Type" => "application/json"}, :body => x)}
run!
end
......@@ -15,7 +15,7 @@ EventMachine.run do
Thin::Server.start Noah::App
r = EventMachine::Hiredis::Client.connect
r.psubscribe("noah.*")
r.psubscribe("//noah/*")
r.on(:pmessage) do |pattern, event, message|
@channel.push "(#{event}) #{message}"
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment