Sha256: 90c75a4d2db6698cabe471bac8fa520ddd6e94c764d1023130c8c2af7d32595c
Contents?: true
Size: 758 Bytes
Versions: 7
Compression:
Stored size: 758 Bytes
Contents
module EMJack module Handler class Buried RESPONSE = /^BURIED(\s+(\d+))?\r\n/ def self.handles?(response) response =~ RESPONSE end def self.handle(deferrable, response, body, conn=nil) return false unless response =~ RESPONSE # if there is an id this is the response of a put command # otherwise, it's either the result of a BURY command or # a release command. I'm assuming the latter 2 are success # and the first is a failure id = $2 if id.nil? deferrable.succeed else deferrable.fail(:buried, id.to_i) end true end EMJack::Connection.register_handler(EMJack::Handler::Buried) end end end
Version data entries
7 entries across 7 versions & 1 rubygems