Class: Mutant::Parallel::Connection Private

Inherits:
Object
  • Object
show all
Defined in:
lib/mutant/parallel/connection.rb

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.

Defined Under Namespace

Classes: Frame, Reader

Constant Summary collapse

Error =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Class.new(RuntimeError)
HEADER_FORMAT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

'N'
HEADER_SIZE =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

4
MAX_BYTES =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

(2**32).pred

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_pipes(marshal:, reader:, writer:) ⇒ Object

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.



169
170
171
172
173
174
175
# File 'lib/mutant/parallel/connection.rb', line 169

def self.from_pipes(marshal:, reader:, writer:)
  new(
    marshal: marshal,
    reader:  Frame.new(io: reader.to_reader),
    writer:  Frame.new(io: writer.to_writer)
  )
end

Instance Method Details

#receive_valueObject

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.



160
161
162
# File 'lib/mutant/parallel/connection.rb', line 160

def receive_value
  marshal.load(reader.receive_value)
end

#send_value(value) ⇒ Object

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.



164
165
166
167
# File 'lib/mutant/parallel/connection.rb', line 164

def send_value(value)
  writer.send_value(marshal.dump(value))
  self
end