Created
November 19, 2012 19:28
-
-
Save tarcieri/4113104 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bundler/setup' | |
require 'celluloid' | |
class Something | |
include Celluloid | |
include Celluloid::Logger | |
def perform | |
# some complex operation | |
sleep 10 | |
info 'performed' | |
end | |
end | |
class Supervisor < Celluloid::SupervisionGroup | |
pool Something, :as => :something | |
end | |
Supervisor.new | |
Celluloid::Actor[:something].async.perform | |
sleep |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@tarcieri using sleep the main thread will not exit after all jobs being processed.
Any ideas?