Sha256: fa083f34a194afa0902da768f2d1cfadd09cce8549c5a7cd00aeda8adeb469c2
Contents?: true
Size: 633 Bytes
Versions: 14
Compression:
Stored size: 633 Bytes
Contents
module Faye class Scheduler def initialize(message, options) @message = message @options = options @attempts = 0 end def interval @options[:interval] end def timeout @options[:timeout] end def deliverable? attempts = @options[:attempts] deadline = @options[:deadline] now = Time.now.to_f return false if attempts and @attempts >= attempts return false if deadline and now > deadline true end def send! @attempts += 1 end def succeed! end def fail! end def abort! end end end
Version data entries
14 entries across 14 versions & 2 rubygems