Sha256: 46b333d63d687b0308fb5f9f014ff2c28a17c158faf6cd47282e8394a6dce9e1

Contents?: true

Size: 686 Bytes

Versions: 4

Compression:

Stored size: 686 Bytes

Contents

require 'choria/colt/data_structurer'

module Choria
  class Orchestrator
    class Task
      class ResultSet
        attr_reader :results

        def initialize(on_result:)
          @results = []
          @on_result = on_result
        end

        def integrate_rpc_error(rpc_error)
          result = rpc_error[:body]
          result[:sender] = rpc_error[:senderid]
          integrate_result(result)
        end

        def integrate_result(result)
          structured_result = Choria::Colt::DataStructurer.structure(result).with_indifferent_access
          @results << structured_result
          @on_result&.call(structured_result)
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
choria-colt-0.7.0 lib/choria/orchestrator/task/result_set.rb
choria-colt-0.6.0 lib/choria/orchestrator/task/result_set.rb
choria-colt-0.5.1 lib/choria/orchestrator/task/result_set.rb
choria-colt-0.5.0 lib/choria/orchestrator/task/result_set.rb