codemix/oriento — pull request #7 by phpnode (2014-04-03 12:21:09+00:00)
Title: Connection pooling

Adds two new classes, `Connection` and `ConnectionPool`. Moves the socket / protocol negotiation code out of the `Server` into the `Connection`. `Connection` and `ConnectionPool` both implement a `send()` method with the same interface. This allows us to treat a connection and a pool of connections in the same way. The connection pool is turned off by default, but is enabled by adding a `pool` object to the server configuration, e.g.

```js
var server = Oriento({
user: 'root',
password: 'foo',
pool: {
max: 10 // use a maximum of 10 sockets in the pool
}
});
```