Class: Ably::Util::SafeDeferrable

Inherits:
Object
  • Object
show all
Includes:
Modules::SafeDeferrable
Defined in:
lib/ably/util/safe_deferrable.rb

Overview

SafeDeferrable class provides a Deferrable that is safe to use for for public interfaces of this client library. Any exceptions raised in the success or failure callbacks are caught and logged to the provided logger.

An exception in a callback provided by a developer should not break this client library and stop further execution of code.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Modules::SafeDeferrable

#callback, #errback, #fail, #succeed

Constructor Details

#initialize(logger) ⇒ SafeDeferrable

Returns a new instance of SafeDeferrable.



14
15
16
# File 'lib/ably/util/safe_deferrable.rb', line 14

def initialize(logger)
  @logger = logger
end

Instance Attribute Details

#loggerObject (readonly)

Returns the value of attribute logger.



12
13
14
# File 'lib/ably/util/safe_deferrable.rb', line 12

def logger
  @logger
end