Ruby Agent: Go-Like Concurrency in Ruby

sakura79 · June 25, 2014 · Last by Kabie replied at June 25, 2014 · 1604 hits

有点意思,就是不知道性能和稳定性怎样。看 GitHub 貌似项目开始挺早了。

http://www.sitepoint.com/agent-go-like-concurrency-ruby/

require 'agent'

chan = channel!(Integer)

go! do
  #the program should only end
  #when this goroutine ends
  sleep 10

  puts "Hello, world!"
  chan << 1
end

puts chan.receive.first

项目主页:https://github.com/igrigorik/agent

CSP, interesting...

有趣。。。不过性能肯定差一些……毕竟是 ruby 级的。。。

You need to Sign in before reply, if you don't have an account, please Sign up first.