You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think the name "Redis" may be overridden in the local scope.
Example code:
#!/usr/bin/env rubyrequire"redis"require"celluloid"require"celluloid/io"require'celluloid/redis'classMyActor# comment this out to prevent the error.includeCelluloid::IOdefinitialize@redis=Redis.new(:driver=>:celluloid)puts"Success."endendma=MyActor.newsleep
Error produced:
$ bundle exec ./bin/redis_spike.rb
E, [2013-07-19T10:49:33.717153 #26935] ERROR -- : MyActor crashed!
NoMethodError: undefined method `new' for Celluloid::Redis:Module
./bin/redis_spike.rb:13:in `initialize'
/home/orospakr/.gem/ruby/2.0.0/gems/celluloid-0.14.1/lib/celluloid/calls.rb:25:in `public_send'
/home/orospakr/.gem/ruby/2.0.0/gems/celluloid-0.14.1/lib/celluloid/calls.rb:25:in `dispatch'
/home/orospakr/.gem/ruby/2.0.0/gems/celluloid-0.14.1/lib/celluloid/calls.rb:67:in `dispatch'
/home/orospakr/.gem/ruby/2.0.0/gems/celluloid-0.14.1/lib/celluloid/actor.rb:326:in `block in handle_message'
/home/orospakr/.gem/ruby/2.0.0/gems/celluloid-0.14.1/lib/celluloid/tasks.rb:42:in `block in initialize'
/home/orospakr/.gem/ruby/2.0.0/gems/celluloid-0.14.1/lib/celluloid/tasks/task_fiber.rb:11:in `block in create'
D, [2013-07-19T10:49:33.718139 #26935] DEBUG -- : Terminating 1 actors...
D, [2013-07-19T10:49:33.718526 #26935] DEBUG -- : Shutdown completed cleanly
./bin/redis_spike.rb:13:in `initialize': undefined method `new' for Celluloid::Redis:Module (NoMethodError)
from /home/orospakr/.gem/ruby/2.0.0/gems/celluloid-0.14.1/lib/celluloid/calls.rb:25:in `public_send'
from /home/orospakr/.gem/ruby/2.0.0/gems/celluloid-0.14.1/lib/celluloid/calls.rb:25:in `dispatch'
from /home/orospakr/.gem/ruby/2.0.0/gems/celluloid-0.14.1/lib/celluloid/calls.rb:67:in `dispatch'
from /home/orospakr/.gem/ruby/2.0.0/gems/celluloid-0.14.1/lib/celluloid/actor.rb:326:in `block in handle_message'
from /home/orospakr/.gem/ruby/2.0.0/gems/celluloid-0.14.1/lib/celluloid/tasks.rb:42:in `block in initialize'
from /home/orospakr/.gem/ruby/2.0.0/gems/celluloid-0.14.1/lib/celluloid/tasks/task_fiber.rb:11:in `block in create'
from (celluloid):0:in `remote procedure call'
from /home/orospakr/.gem/ruby/2.0.0/gems/celluloid-0.14.1/lib/celluloid/calls.rb:95:in `value'
from /home/orospakr/.gem/ruby/2.0.0/gems/celluloid-0.14.1/lib/celluloid/proxies/sync_proxy.rb:28:in `method_missing'
from /home/orospakr/.gem/ruby/2.0.0/gems/celluloid-0.14.1/lib/celluloid/legacy.rb:14:in `method_missing'
from /home/orospakr/.gem/ruby/2.0.0/gems/celluloid-0.14.1/lib/celluloid/proxies/actor_proxy.rb:25:in `_send_'
from /home/orospakr/.gem/ruby/2.0.0/gems/celluloid-0.14.1/lib/celluloid.rb:129:in `new'
from ./bin/redis_spike.rb:19:in `<main>'
Commenting out include Celluloid::IO prevents the error.
Is it unreasonable for me to want to use Celluloid::Redis from inside a Celluloid::IO actor? I would have thought that a Celluloid::IO Actor is just the right place to use Celluloid::Redis from, since it needs the IO reactor.
I think the name "Redis" may be overridden in the local scope.
Example code:
Error produced:
Commenting out
include Celluloid::IOprevents the error.Is it unreasonable for me to want to use Celluloid::Redis from inside a Celluloid::IO actor? I would have thought that a Celluloid::IO Actor is just the right place to use Celluloid::Redis from, since it needs the IO reactor.