Skip to content

Instantly share code, notes, and snippets.

@Poincare
Created July 24, 2012 12:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Poincare/3169620 to your computer and use it in GitHub Desktop.
Save Poincare/3169620 to your computer and use it in GitHub Desktop.
require 'celluloid'
require 'mathn'
class PrimeWorker
include Celluloid
def prime(number)
if number.prime?
puts number
end
end
end
pool = PrimeWorker.pool
(2..1000).to_a.map do |i|
pool.prime! i
end
sleep 100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment