Sha256: 02e5c03521548a0655ef3125ac6e41e3d5f9cac6ab7d7de4ea0bf9891f3a753a
Contents?: true
Size: 433 Bytes
Versions: 11
Compression:
Stored size: 433 Bytes
Contents
module Deepstream class AckTimeoutRegistry def initialize(client) @client = client @timeouts = {} end def add(name, message) return unless (timeout = @client.options[:ack_timeout]) @timeouts[name] = Thread.new do sleep timeout @client.on_error(message) end end def cancel(name) @timeouts[name].exit rescue nil @timeouts.delete(name) end end end
Version data entries
11 entries across 11 versions & 1 rubygems