Skip to content

Instantly share code, notes, and snippets.

@tarcieri
Created November 19, 2012 19:28
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 tarcieri/4113104 to your computer and use it in GitHub Desktop.
Save tarcieri/4113104 to your computer and use it in GitHub Desktop.
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
@sobrinho
Copy link

@tarcieri using sleep the main thread will not exit after all jobs being processed.

Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment