Sha256: 585c579c042879f07a9b315f848f712168ee929cf7e6f56559970369cba5a89a

Contents?: true

Size: 422 Bytes

Versions: 9

Compression:

Stored size: 422 Bytes

Contents

module EMJack
  module Handler
    class Watching
      RESPONSE = /^WATCHING\s+(\d+)\r\n/

      def self.handles?(response)
        response =~ RESPONSE
      end

      def self.handle(deferrable, response, body, conn=nil)
        return false unless response =~ RESPONSE

        deferrable.succeed($1.to_i)
        true
      end

      EMJack::Connection.register_handler(EMJack::Handler::Watching)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
em-jack-0.1.5 lib/em-jack/handlers/watching.rb
em-jack-0.1.4 lib/em-jack/handlers/watching.rb
em-jack-0.1.3 lib/em-jack/handlers/watching.rb
em-jack-0.1.2 lib/em-jack/handlers/watching.rb
em-jack-0.1.1 lib/em-jack/handlers/watching.rb
em-jack-0.1.0 lib/em-jack/handlers/watching.rb
em-jack-0.0.9 lib/em-jack/handlers/watching.rb
em-jack-0.0.8 lib/em-jack/handlers/watching.rb
em-jack-0.0.7 lib/em-jack/handlers/watching.rb