Created
January 22, 2015 02:22
-
-
Save anonymous/15475bf7eca34135bdf3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require_relative "../lib/database.rb" | |
EM.run do | |
Database.pool.wait_for_notify_defer(10).callback do |notification| | |
puts "hello world notification" | |
end.errback do |ex| | |
puts "Errback" | |
end | |
puts "here" | |
Database.pool.query_defer("LISTEN #{AppConfig.channel}") do | |
Database.pool.query_defer("NOTIFY #{AppConfig.channel}") | |
puts "notified" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment