By: Esteban
Isn’t there a way to tell the program to wait for the actors before finishing? Something like Thread#join ?
View ArticleBy: Dhaivat Pandya
The square operation is too “simple” (not computationally intensive) for it to be worthwhile using the actor pool.
View ArticleBy: Dhaivat Pandya
Hi,You can use supervision groups – those will most likely be covered in Part 3.
View ArticleBy: Jonathan Rochkind
Super useful, thanks! I’m going to have to read it a couple more times to fully understand what’s going on.But one question about supervise. In your example you’re doing supervise_as inside the loop....
View ArticleBy: Dhaivat Pandya
The question you bring up is important.The registry doesn’t have anything to do with supervision – it is for the programmer’s use, not for Celluloid. So, by overwriting the registry, we are not...
View ArticleBy: Jonathan Rochkind
okay, cool. Is there a way to supervise without using the registry then? In your example wit supervise_as, the registry seems to have something to do with supervision, yeah? In your example, the only...
View ArticleBy: Jonathan Rochkind
Ah, I see there is in the docs. https://github.com/celluloid/celluloid/wiki/SupervisorsIn fact, for your particular example… I don’t think supervision gets you anything. It’ll restart the actor if it’s...
View ArticleBy: Jabari
You did:(2..1000).to_a.map do |i| pool.prime! i endSimpler and faster:(2..1000).each {|i| pool.prime! i }
View ArticleBy: Jabari
Also, for more idiomatic Ruby code:This def prime(number) if number.prime? puts number end endis more idiomatic Ruby as this: def prime(number) puts number if number.prime? endor this as oneliner: def...
View Article
More Pages to Explore .....