Sha256: 26ca0fbb1e8698025945bb2904c5eefdff15fa618dd9ccb6ea3d50acbc1b9b09

Contents?: true

Size: 558 Bytes

Versions: 1

Compression:

Stored size: 558 Bytes

Contents

module Mutant
  # Module providing isolationg
  module Isolation
    Error = Class.new(RuntimeError)

    # Call block in isolation
    #
    # This isolation implements the fork strategy.
    # Future strategies will probably use a process pool that can
    # handle multiple mutation kills, in-isolation at once.
    #
    # @return [Object]
    #
    # @raise [Error]
    #
    # @api private
    #
    def self.call(&block)
      Parallel.map([block], in_processes: 1) do |block|
        block.call
      end.first
    end

  end # Isolator
end # Mutant

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mutant-0.5.23 lib/mutant/isolation.rb