Skip to content

Eventmachine 0.12.10, new API breaks neverblock #2

@kainosnoema

Description

@kainosnoema

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions