Sha256: 15398bbab04d4e044c40ce5a228da288006f1d80f4c1c51d94de0c00f685b981
Contents?: true
Size: 854 Bytes
Versions: 18
Compression:
Stored size: 854 Bytes
Contents
require 'asir/transport/composite' module ASIR class Transport # !SLIDE # Fallback Transport class Fallback < self include Composite def _send_message message, message_payload result = sent = first_exception = nil transports.each do | transport | begin result = transport.send_message(message) sent = true break rescue ::Exception => exc first_exception ||= exc _handle_send_message_exception! transport, message, exc end end unless sent if first_exception && @reraise_first_exception raise first_exception end raise FallbackError, "fallback failed" end result end class FallbackError < Error; end end # !SLIDE END end end
Version data entries
18 entries across 18 versions & 1 rubygems