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

Inherits:
Object
  • Object
show all
Includes:
Unparser::Adamantium
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)


44
45
46
47
48
# File 'lib/mutant/isolation/fork.rb', line 44

def self.with(io)
  io.pipe(binmode: true) do |(reader, writer)|
    yield new(reader:, 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)


53
54
55
56
# File 'lib/mutant/isolation/fork.rb', line 53

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)


61
62
63
64
# File 'lib/mutant/isolation/fork.rb', line 61

def parent
  writer.close
  reader
end