lib/bbk/app/dispatcher.rb in bbk-app-1.0.0.80957 vs lib/bbk/app/dispatcher.rb in bbk-app-1.0.0.141716

- old
+ new

@@ -114,15 +114,19 @@ logger.debug e.backtrace end end end + def execute_message(message) + build_processing_stack.call(message).select do |r| + r.is_a?(BBK::App::Dispatcher::Result) + end + end + protected def process(message) - results = build_processing_stack.call(message).select do |e| - e.is_a? BBK::App::Dispatcher::Result - end + results = execute_message(message) logger.debug "There are #{results.count} results to send from #{message.headers[:message_id]}..." send_results(message, results).value rescue StandardError => e logger.error "Failed processing message: #{e.inspect}" ActiveSupport::Notifications.instrument 'dispatcher.exception', msg: message, exception: e