123456789_123456789_123456789_123456789_123456789_

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

Class Method Summary

Instance Method Summary

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(message)
  packet = Marshal.dump(message)
  @write_io.write("#{packet.bytesize}\n#{packet}")
end