lib/asir/transport/delegation.rb in asir-1.1.12 vs lib/asir/transport/delegation.rb in asir-1.2.0
- old
+ new
@@ -12,20 +12,15 @@
attr_accessor :on_send_message_exception
# Proc to call(transport, message) when #send_message fails with no recourse.
attr_accessor :on_failed_message
- # Return the subTransports#send_message result unmodified from #_send_message.
- def _receive_result message, opaque_result
- opaque_result
+ # Return the subTransports' result unmodified from #_send_message.
+ def _receive_result state
+ true
end
- # Return the subTransports#send_message result unmodified from #_send_message.
- def receive_result message, opaque_result
- opaque_result
- end
-
def needs_message_identifier? message
@needs_message_identifier ||
transports.any? { | t | t.needs_message_identifier?(message) }
end
@@ -38,13 +33,13 @@
def transports
@transports ||= [ transport ]
end
# Called from within _send_message rescue.
- def _handle_send_message_exception! transport, message, exc
- _log { [ :send_message, :transport_failed, exc ] }
- (message[:transport_exceptions] ||= [ ]) << "#{exc.inspect}: #{exc.backtrace.first}"
- @on_send_message_exception.call(self, message, exc) if @on_send_message_exception
+ def _handle_send_message_exception! transport, state, exc
+ _log { [ :send_message, :transport_failed, exc, exc.backtrace ] }
+ (state.message[:transport_exceptions] ||= [ ]) << "#{exc.inspect}: #{exc.backtrace.first}"
+ @on_send_message_exception.call(self, state, exc) if @on_send_message_exception
self
end
end
# !SLIDE END
end