Class: Mutant::Parallel::Connection::Frame 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.

Instance Method Summary collapse

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.



138
139
140
# File 'lib/mutant/parallel/connection.rb', line 138

def receive_value
  read(Util.one(read(HEADER_SIZE).unpack(HEADER_FORMAT)))
end

#send_value(body) ⇒ 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.



142
143
144
145
146
147
148
149
150
# File 'lib/mutant/parallel/connection.rb', line 142

def send_value(body)
  bytesize = body.bytesize

  fail Error, 'message to big' if bytesize > MAX_BYTES

  io.binmode
  io.write([bytesize].pack(HEADER_FORMAT))
  io.write(body)
end