Class: EMJack::Handler::Watching
- Inherits:
-
Object
- Object
- EMJack::Handler::Watching
- Defined in:
- lib/em-jack/handlers/watching.rb
Constant Summary collapse
- RESPONSE =
/^WATCHING\s+(\d+)\r\n/
Class Method Summary collapse
Class Method Details
.handle(deferrable, response, body, conn = nil) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/em-jack/handlers/watching.rb', line 10 def self.handle(deferrable, response, body, conn=nil) return false unless response =~ RESPONSE deferrable.succeed($1.to_i) true end |
.handles?(response) ⇒ Boolean
6 7 8 |
# File 'lib/em-jack/handlers/watching.rb', line 6 def self.handles?(response) response =~ RESPONSE end |