Class: Circuitry::Publisher

Inherits:
Object
  • Object
show all
Includes:
Concerns::Async, Services::SNS
Defined in:
lib/circuitry/testing.rb,
lib/circuitry/publisher.rb

Constant Summary collapse

DEFAULT_OPTIONS =
{
  async: false,
  timeout: 15
}.freeze
CONNECTION_ERRORS =
[
  ::Seahorse::Client::NetworkingError,
  ::Aws::SNS::Errors::InternalFailure
].freeze

Instance Attribute Summary collapse

Attributes included from Concerns::Async

#async

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Services::SNS

#sns

Methods included from Concerns::Async

#async?, included, #process_asynchronously

Constructor Details

#initialize(options = {}) ⇒ Publisher

Returns a new instance of Publisher.



25
26
27
28
29
30
# File 'lib/circuitry/publisher.rb', line 25

def initialize(options = {})
  options = DEFAULT_OPTIONS.merge(options)

  self.async = options[:async]
  self.timeout = options[:timeout]
end

Instance Attribute Details

#timeoutObject

Returns the value of attribute timeout.



23
24
25
# File 'lib/circuitry/publisher.rb', line 23

def timeout
  @timeout
end

Class Method Details

.default_async_strategyObject



46
47
48
# File 'lib/circuitry/publisher.rb', line 46

def self.default_async_strategy
  Circuitry.publisher_config.async_strategy
end

Instance Method Details

#publish(topic_name, object) ⇒ Object

Raises:

  • (ArgumentError)


5
6
7
# File 'lib/circuitry/testing.rb', line 5

def publish(_topic_name, _object)
  # noop
end