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
MAX_LOG_CHUNK =

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.

4096

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.



172
173
174
175
176
177
178
# File 'lib/mutant/parallel/connection.rb', line 172

def self.from_pipes(marshal:, reader:, writer:)
  new(
    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.



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

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.



167
168
169
170
# File 'lib/mutant/parallel/connection.rb', line 167

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