Issue #38 new

Make pg's async interface play nicely with Ruby 1.9's Fibers

Michael Granger
repo owner created an issue

The asynchronous interface in the library is currently very low-level, and requires the programmer to manage IO for operations themselves at the socket level (see the [[http://bitbucket.org/ged/ruby-pg/src/tip/spec/pgconn_spec.rb#cl-56|spec for PGconn#connect_start]] for an example).

Ruby's Fibers are a new construct in Ruby 1.9 that promises to simplify the management of asynchronous code [[http://www.igvita.com/2010/03/22/untangling-evented-code-with-ruby-fibers/|without requiring the programmer to do callbacks]] or polling.

I think a simplified asynchronous interface could be implemented using Fibers on top of the present async API so that more people could take advantage of it with only small code changes.

Comments (4)

  1. Log in to comment