chrisroberts / krakow

Ruby client library for NSQ
Other
99 stars 17 forks source link

Fibers error #2

Closed lindemannrichard closed 10 years ago

lindemannrichard commented 10 years ago

I have tried to test a simple example:

require 'krakow'

producer = Krakow::Producer.new(
  :host => 'localhost',
  :port => '4150',
  :topic => 'target'
)
producer.write('KRAKOW!', 'KRAKOW!')

tried all MRIs 2.x

ruby -v
ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin13.0]

But what I get is this error:

I, [2014-02-26T22:46:07.639852 #97388]  INFO -- : <Krakow::Producer:70221130686400 {127.0.0.1:4150} T:target>: Establishing connection to: 127.0.0.1:4150
D, [2014-02-26T22:46:07.670805 #97388] DEBUG -- : Terminating 2 actors...
W, [2014-02-26T22:46:07.671329 #97388]  WARN -- : Terminating task: type=:call, meta={:method_name=>:initialize}, status=:callwait
D, [2014-02-26T22:46:07.671464 #97388] DEBUG -- : <Krakow::Producer:70221130686400 {127.0.0.1:4150} T:target>: Tearing down producer
W, [2014-02-26T22:46:07.671669 #97388]  WARN -- : Terminating task: type=:call, meta={:method_name=>:supervise_as}, status=:callwait
I, [2014-02-26T22:46:07.671752 #97388]  INFO -- : <Krakow::Producer:70221130686400 {127.0.0.1:4150} T:target>: Producer torn down
/Users/rl/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/celluloid-0.15.2/lib/celluloid/tasks/task_fiber.rb:18:in `yield': fiber called across stack rewinding barrier (FiberError)
    from /Users/rl/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/celluloid-0.15.2/lib/celluloid/tasks/task_fiber.rb:18:in `signal'

or this one

I, [2014-02-26T22:44:21.308145 #97114]  INFO -- : <Krakow::Producer:70166093643940 {127.0.0.1:4150} T:target>: Establishing connection to: 127.0.0.1:4150
D, [2014-02-26T22:44:21.343482 #97114] DEBUG -- : Terminating 2 actors...
D, [2014-02-26T22:44:21.343784 #97114] DEBUG -- : <Krakow::Producer:70166093643940 {127.0.0.1:4150} T:target>: Tearing down producer
I, [2014-02-26T22:44:21.343855 #97114]  INFO -- : <Krakow::Producer:70166093643940 {127.0.0.1:4150} T:target>: Producer torn down
W, [2014-02-26T22:44:21.344098 #97114]  WARN -- : Terminating task: type=:call, meta={:method_name=>:initialize}, status=:callwait
E, [2014-02-26T22:44:21.344331 #97114] ERROR -- : Celluloid::Notifications::Fanout crashed!
NoMethodError: undefined method `reject!' for nil:NilClass
    /Users/rl/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/celluloid-0.15.2/lib/celluloid/notifications.rb:55:in `prune'

Does that means that Celluloid does not work with MRI Rubies 2.x ? (and as consequence => krakow fails)

lindemannrichard commented 10 years ago

It seems that adding

require 'celluloid/autostart'

fixed the problem. I think that this might be mentioned in the README.

chrisroberts commented 10 years ago

ah, this looks like my mistake not having that include by default. will add. thanks for the report!