Class: MultiProcess::StringReceiver

Inherits:
Receiver
  • Object
show all
Defined in:
lib/multi_process/string_receiver.rb

Overview

Receiver implementation storing process output in string.

Instance Attribute Summary

Attributes inherited from Receiver

#mutex

Instance Method Summary collapse

Methods inherited from Receiver

#initialize, #message, #pipe

Constructor Details

This class inherits a constructor from MultiProcess::Receiver

Instance Method Details

#get(name) ⇒ Object



10
11
12
13
# File 'lib/multi_process/string_receiver.rb', line 10

def get(name)
  @strings ||= {}
  @strings[name.to_s] ||= ''
end

#received(_process, name, message) ⇒ Object



6
7
8
# File 'lib/multi_process/string_receiver.rb', line 6

def received(_process, name, message)
  get(name) << message
end