Class: Mutant::Isolation::Fork::Pipe Private
- Inherits:
-
Object
- Object
- Mutant::Isolation::Fork::Pipe
- 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
-
.with(io) ⇒ undefined
private
Run block with pipe in binmode.
Instance Method Summary collapse
-
#child ⇒ IO
private
Child writer end of the pipe.
-
#parent ⇒ IO
private
Parent reader end of the pipe.
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
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
#child ⇒ IO
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
53 54 55 56 |
# File 'lib/mutant/isolation/fork.rb', line 53 def child reader.close writer end |
#parent ⇒ IO
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
61 62 63 64 |
# File 'lib/mutant/isolation/fork.rb', line 61 def parent writer.close reader end |