This is written by others, I think it's fun so post it here.
require "./erl_scheduler"
require "./erl_process"
scheduler = ErlScheduler.new
counter = scheduler.spawn(Counter)
10000.times do |i|
scheduler.send_message(counter, :inc)
end
scheduler.send_message(counter, :stop)
scheduler.loop
Top comments (0)