igrigorik/em-synchrony — Issue #107: EM-Jack & EM-Mongo, `yield': can't yield from root fiber (FiberError)
Author: wedtm
Created: 2012-01-20 12:05:20+00:00
State: open

I have a `EMJack#each_job` loop running and within that I call a `find` on a mongodb collection. I get the following error:

/Users/wedtm/.rvm/gems/ruby-1.9.2-p180/bundler/gems/em-synchrony-c7209a58f9eb/lib/em-synchrony/em-mongo.rb:67:in `yield': can't yield from root fiber (FiberError)
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180/bundler/gems/em-synchrony-c7209a58f9eb/lib/em-synchrony/em-mongo.rb:67:in `find'
from emp.rb:26:in `work'
from emp.rb:21:in `block (2 levels) in

'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180/bundler/gems/em-jack-ecd85bf2747a/lib/em-jack/connection.rb:234:in `call'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180/bundler/gems/em-jack-ecd85bf2747a/lib/em-jack/connection.rb:234:in `block (2 levels) in each_job'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180/gems/eventmachine-1.0.0.beta.4/lib/em/deferrable.rb:151:in `call'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180/gems/eventmachine-1.0.0.beta.4/lib/em/deferrable.rb:151:in `set_deferred_status'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180/gems/eventmachine-1.0.0.beta.4/lib/em/deferrable.rb:191:in `succeed'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180/bundler/gems/em-jack-ecd85bf2747a/lib/em-jack/handlers/reserved.rb:20:in `handle'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180/bundler/gems/em-jack-ecd85bf2747a/lib/em-jack/connection.rb:356:in `block in received'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180/bundler/gems/em-jack-ecd85bf2747a/lib/em-jack/connection.rb:340:in `each'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180/bundler/gems/em-jack-ecd85bf2747a/lib/em-jack/connection.rb:340:in `received'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180/bundler/gems/em-jack-ecd85bf2747a/lib/em-jack/beanstalk_connection.rb:12:in `receive_data'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180/gems/eventmachine-1.0.0.beta.4/lib/eventmachine.rb:179:in `run_machine'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180/gems/eventmachine-1.0.0.beta.4/lib/eventmachine.rb:179:in `run'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180/bundler/gems/em-synchrony-c7209a58f9eb/lib/em-synchrony.rb:28:in `synchrony'
from emp.rb:12:in `

'

Any help is greatly appreciated!