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
| [R] | fd | needed to access the sockect by the event loop |
| [R] | io | needed to access the sockect by the event loop |
Creates a new postgresql connection, sets it to nonblocking and wraps the descriptor in an IO object.
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.
The callback, this is called whenever there is data available at the socket
Attaches the connection socket to an event loop. Currently only supports EM, but Rev support will be completed soon.