Sha256: 53224b0f162dd02355f85d5530f755d12277680969f57d0bcc2863057b7f4187
Contents?: true
Size: 608 Bytes
Versions: 17
Compression:
Stored size: 608 Bytes
Contents
module DeadlySerious module Processes class Splitter def initialize Signal.trap('USR1') { @outputs = @writers.dup } end def run(readers: [], writers: []) @writers ||= writers reader = readers.first @outputs = @writers.dup begin reader.each do |line| @current = @outputs.first @current << line @outputs.rotate! end rescue => e puts e.inspect @outputs.delete(@current) raise e if @outputs.empty? retry end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems