Sha256: 625cece4ba82062b15d8967b4dfe4f748bcf56c1d687a7570f619fa21eb1943c
Contents?: true
Size: 592 Bytes
Versions: 1
Compression:
Stored size: 592 Bytes
Contents
module Rodimus class Transformation attr_reader :steps def initialize @steps = [] end def run prepare steps.each do |step| fork do step.run end step.incoming && step.incoming.close step.outgoing && step.outgoing.close end Process.waitall end private def prepare # [1, 2, 3, 4] => [1, 2], [2, 3], [3, 4] steps.inject do |first, second| read, write = IO.pipe first.outgoing = write second.incoming = read second end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rodimus-0.0.1 | lib/rodimus/transformation.rb |