Class: Mutant::Isolation::Fork::Pipe Private
- Inherits:
-
Object
- Object
- Mutant::Isolation::Fork::Pipe
- 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
-
.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
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
#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
39 40 41 42 |
# File 'lib/mutant/isolation/fork.rb', line 39 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
47 48 49 50 |
# File 'lib/mutant/isolation/fork.rb', line 47 def parent writer.close reader end |