A modified postgres connection driver builds on the original pg driver. This driver is able to register the socket at a certain backend (EM or Rev) and then whenever the query is executed within the scope of a friendly fiber it will be done in async mode and the fiber will yield

Methods
Attributes
[R] fd needed to access the sockect by the event loop
[R] io needed to access the sockect by the event loop
Public Class methods
new(*args) [ source ]

Creates a new postgresql connection, sets it to nonblocking and wraps the descriptor in an IO object.

Public Instance methods
exec(sql) [ source ]

Assuming the use of NeverBlock fiber extensions and that the exec is run in the context of a fiber. One that have the value :neverblock set to true. All neverblock IO classes check this value, setting it to false will force the execution in a blocking way.

process_command() [ source ]

The callback, this is called whenever there is data available at the socket

register_with_event_loop(loop) [ source ]

Attaches the connection socket to an event loop. Currently only supports EM, but Rev support will be completed soon.