Class: Mutant::Isolation::Fork::Pipe Private

Inherits:
Object
  • Object
show all
Includes:
Adamantium::Flat
Defined in:
lib/mutant/isolation/fork.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Pipe abstraction

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.with(io) ⇒ undefined

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Run block with pipe in binmode

Returns:

  • (undefined)


30
31
32
33
34
# File 'lib/mutant/isolation/fork.rb', line 30

def self.with(io)
  io.pipe(binmode: true) do |(reader, writer)|
    yield new(reader: reader, writer: writer)
  end
end

Instance Method Details

#childIO

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Child writer end of the pipe

Returns:

  • (IO)


39
40
41
42
# File 'lib/mutant/isolation/fork.rb', line 39

def child
  reader.close
  writer
end

#parentIO

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parent reader end of the pipe

Returns:

  • (IO)


47
48
49
50
# File 'lib/mutant/isolation/fork.rb', line 47

def parent
  writer.close
  reader
end