Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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