Sha256: c288633a02960833e1fe8b6af0460709e4450f800af48fc5ed97baa9420a7334
Contents?: true
Size: 772 Bytes
Versions: 4
Compression:
Stored size: 772 Bytes
Contents
class TD::UpdateHandler include Concurrent::Async attr_reader :update_type, :extra def initialize(update_type, extra = nil, disposable: false, &action) super() @action = action @update_type = update_type @extra = extra @disposable = disposable end def run(update) action.call(update) rescue StandardError => e warn("Uncaught exception in handler #{self}: #{e.message}") raise end def match?(update, extra = nil) update.is_a?(update_type) && (self.extra.nil? || self.extra == extra) end def disposable? disposable end def to_s "TD::UpdateHandler (#{update_type}#{": #{extra}" if extra})#{' disposable' if disposable?}" end alias inspect to_s private attr_reader :action, :disposable end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
tdlib-ruby-3.1.0 | lib/tdlib/update_handler.rb |
tdlib-ruby-3.0.2 | lib/tdlib/update_handler.rb |
tdlib-ruby-3.0.1 | lib/tdlib/update_handler.rb |
tdlib-ruby-3.0.0 | lib/tdlib/update_handler.rb |