Class: Mutant::Pipe::Connection Private
- Inherits:
-
Object
- Object
- Mutant::Pipe::Connection
- Defined in:
- lib/mutant/pipe.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
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)
Class Method Summary collapse
Instance Method Summary collapse
- #call(payload) ⇒ Object private
- #receive_value ⇒ Object private
- #send_value(value) ⇒ Object private
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.
97 98 99 100 101 102 103 |
# File 'lib/mutant/pipe.rb', line 97 def self.from_pipes(marshal:, reader:, writer:) new( marshal: marshal, reader: Frame.new(reader.to_reader), writer: Frame.new(writer.to_writer) ) end |
Instance Method Details
#call(payload) ⇒ 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.
83 84 85 86 |
# File 'lib/mutant/pipe.rb', line 83 def call(payload) send_value(payload) receive_value end |
#receive_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.
88 89 90 |
# File 'lib/mutant/pipe.rb', line 88 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.
92 93 94 95 |
# File 'lib/mutant/pipe.rb', line 92 def send_value(value) writer.send_value(marshal.dump(value)) self end |