This repository has been archived on 2015-04-30. You can view files and clone it, but cannot push or open issues or pull requests.
stream/ruby/example.rb
2015-04-29 17:14:31 -04:00

28 lines
414 B
Ruby

$LOAD_PATH << '.'
require "jsh"
def main
s = Stream.new $stdout, 4
s.start!
7.times do |i|
proc = {:pid => i + 1, :name => "init"}
s.output(:things, proc)
end
q = s.new_stream 'q'
q.output(:test, 'potato')
10.times do |i|
proc = {:pid => i + 1, :name => "init"}
s.output(:processes, proc)
end
q.output(:test, "salad")
q.output(:test, "rocks")
s.flush
s.stop!
end
main