Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eventmachine 0.12.10, new API breaks neverblock #2

Open
kainosnoema opened this issue Oct 28, 2009 · 0 comments
Open

Eventmachine 0.12.10, new API breaks neverblock #2

kainosnoema opened this issue Oct 28, 2009 · 0 comments

Comments

@kainosnoema
Copy link

Note this API change in eventmachine for 0.12.10:

 - added EM.watch for notifications about file descriptors
      for notify_read/writable events, you cannot use EM.attach
      EM.watch(fd, Watcher){ |c| c.notify_readable = true }

Because of this change, neverblock quit working with EM 0.12.10. I was getting a "notify_readable/writable with EM.attach is not supported... " error.

I'm not sure if this is the only change that needed to be made, but I changed line 16 in lib/neverblock/db/fibered_db_connection.rb from:

@fiber[key] = EM::attach(socket,EMConnectionHandler,self)

to:

@fiber[key] = EM::watch(socket,EMConnectionHandler,self) { |c| c.notify_readable = true }

It seems like everything is working for me now.

Evan Owen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant