Skip to content

Instantly share code, notes, and snippets.

@olleolleolle
Created September 1, 2014 13:05
Show Gist options
  • Save olleolleolle/8d70e0651c7006d4cc6e to your computer and use it in GitHub Desktop.
Save olleolleolle/8d70e0651c7006d4cc6e to your computer and use it in GitHub Desktop.
Celluloid 0.16.0.pre3 issue description: When running these quite small actors in a supervised pool, they do not start they are not available in the Celluloid::Actor[] registry as they were in v0.15.2.
#gem 'celluloid', '>= 0.16.0.pre3'
gem 'celluloid', '>= 0.15.2'
gem 'rspec'
GEM
specs:
celluloid (0.15.2)
timers (~> 1.1.0)
diff-lcs (1.2.5)
rspec (3.0.0)
rspec-core (~> 3.0.0)
rspec-expectations (~> 3.0.0)
rspec-mocks (~> 3.0.0)
rspec-core (3.0.4)
rspec-support (~> 3.0.0)
rspec-expectations (3.0.4)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.0.0)
rspec-mocks (3.0.4)
rspec-support (~> 3.0.0)
rspec-support (3.0.4)
timers (1.1.0)
PLATFORMS
ruby
DEPENDENCIES
celluloid (>= 0.15.2)
rspec
require 'celluloid'
class SmallActor
include Celluloid
def example_method
:dude
end
end
class SmallActorSupervisor < Celluloid::SupervisionGroup
pool SmallActor, as: :small_actor
end
SmallActorSupervisor.run!
class SmallInterface
def method_missing(method_sym, *arguments, &block)
Celluloid::Actor[:small_actor].public_send(method_sym, *arguments, &block)
end
end
require "small_actor"
describe SmallActor do
before do
Celluloid.boot
sleep 0.1
Celluloid::Actor[:small_actor].example_method
end
after do
Celluloid.shutdown
end
it 'is running' do
expect(Celluloid::Actor[:small_actor]).not_to be_nil
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment