Sha256: be5abc99144425e7900b6c060234d3b4f787cd9b2043e24f9f584ab9884d9e5c

Contents?: true

Size: 800 Bytes

Versions: 2

Compression:

Stored size: 800 Bytes

Contents

# frozen_string_literal: true

module BloodContracts
  module Instrumentation
    module SessionFinalizer
      # Basic implementation of Session finaliazer
      module Basic
        # Run the instruments against the session in a loop
        # Pros:
        #   - simplest, obvious logic
        # Cons:
        #   - failure in one instrument affects the others
        #
        # @param instruments [Array<Instrument>] list of Instruments to run
        #   against the session
        # @param session [Session] object that hold information about matching
        #   process, argument for Instrument#call
        #
        # @return [Nothing]
        #
        def self.finalize!(instruments, session)
          instruments.each { |i| i.call(session) }
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
blood_contracts-instrumentation-0.1.1 lib/blood_contracts/instrumentation/session_finalizer/basic.rb
blood_contracts-instrumentation-0.1.0 lib/blood_contracts/instrumentation/session_finalizer/basic.rb