Method: MultiProcess::Receiver#pipe
- Defined in:
- lib/multi_process/receiver.rb
#pipe(process, name) ⇒ Object
Request a new pipe writer for given process and name.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/multi_process/receiver.rb', line 12 def pipe(process, name) reader, writer = IO.pipe Loop.instance.watch(reader) do |action, monitor| case action when :registered connected(process, name) when :ready received(process, name, read(monitor.io)) when :eof removed(process, name) end end writer end |