lib/never_block/db/fibered_postgres_connection.rb
# Attaches the connection socket to an event loop.
# Currently only supports EM, but Rev support will be
# completed soon.
Attaches the connection socket to an event loop.
Currently only supports EM, but Rev support will be
completed soon.
Attaches the connection socket to an event loop . Currently only supports EM but Rev support will be completed soon .
def register_with_event_loop(loop)
        if loop == :em
          unless EM.respond_to?(:attach)
            puts "invalide EM version, please download the modified gem from: (http://github.com/riham/eventmachine)"
            exit
          end
          if EM.reactor_running?
             @em_connection = EM::attach(@io,EMConnectionHandler,self)
          else
            raise "REACTOR NOT RUNNING YA ZALAMA"
          end 
        elsif loop.class.name == "REV::Loop"
          loop.attach(RevConnectionHandler.new(socket))
        else
          raise "could not register with the event loop"
        end
        @loop = loop
      end
def register_with_event_loop ( loop ) if loop == :em unless EM . respond_to? ( :attach ) puts "invalide EM version, please download the modified gem from: (http://github.com/riham/eventmachine)" exit end if EM . reactor_running? @em_connection = EM :: attach ( @io , EMConnectionHandler , self ) else raise "REACTOR NOT RUNNING YA ZALAMA" end elsif loop . class . name == "REV::Loop" loop . attach ( RevConnectionHandler . new ( socket ) ) else raise "could not register with the event loop" end @loop = loop end
Attaches the connection socket to an event loop.
Attaches the connection socket to an event loop .
loop
<not_specific>