Sha256: 449f9d21c9033494940777b10ee03bd583f2d37d804c22ebb5ef3166fe6bf240
Contents?: true
Size: 941 Bytes
Versions: 1
Compression:
Stored size: 941 Bytes
Contents
module DeadlySerious module Engine # @deprecated Simplifying, simplifying, simplifying module BaseProcess def run(readers: [], writers:[]) reader = readers.first @writer = writers.first if reader reader.each { |packet| super(packet.chomp) } else super() end rescue Errno::EPIPE # Ignore it. We expect that sometimes =) end # Send a packet to the next process def send(packet = nil) send_buffered(packet) flush_buffer end alias :emit :send # Send a packet to the next process, # however, accumulate some of them # before send to gain a little # efficency. def send_buffered(packet = nil) @writer << packet if packet @writer << "\n" end # Send all not yet sent packets. def flush_buffer @writer.flush end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
deadly_serious-0.12.0 | lib/deadly_serious/engine/base_process.rb |