Class: RSpec::Core::Bisect::Channel Private
Do not use. This class is for internal use only.
Relationships & Source Files | |
Inherits: | Object |
Defined in: | rspec-core/lib/rspec/core/bisect/utilities.rb |
Overview
Wraps a pipe to support sending objects between a child and parent process. Where supported, encoding is explicitly set to ensure binary data is able to pass from child to parent.
Constant Summary
-
MARSHAL_DUMP_ENCODING =
# File 'rspec-core/lib/rspec/core/bisect/utilities.rb', line 38Marshal.dump("").encoding
Class Method Summary
- .new ⇒ Channel constructor Internal use only
Instance Method Summary
- #close Internal use only
- #receive Internal use only
- #send(message) Internal use only
Instance Method Details
#close
[ GitHub ]# File 'rspec-core/lib/rspec/core/bisect/utilities.rb', line 62
def close @read_io.close @write_io.close end
#receive
[ GitHub ]# File 'rspec-core/lib/rspec/core/bisect/utilities.rb', line 56
def receive packet_size = Integer(@read_io.gets) Marshal.load(@read_io.read(packet_size)) end
#send(message)
[ GitHub ]# File 'rspec-core/lib/rspec/core/bisect/utilities.rb', line 50
def send( ) packet = Marshal.dump( ) @write_io.write("#{packet.bytesize}\n#{packet}") end