Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

co-rethinkdb

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

co-rethinkdb - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

7

index.js

@@ -45,3 +45,5 @@ // When installing co-rethinkdb for an application that uses the same version

var conn = yield r.getConnection
done(null, yield run.call(query, conn))
var res = yield run.call(query, conn)
yield r.releaseConnection(conn)
done(null, res)
})()

@@ -61,2 +63,5 @@ }

r.releaseConnection = function*() {
}
module.exports = r

2

package.json
{
"name": "co-rethinkdb",
"version": "1.0.0",
"version": "1.1.0",
"author": "Markus Ast <npm.m@rkusa.st>",

@@ -5,0 +5,0 @@ "description": "Generator based querying goodness for RethinkDB",

@@ -6,3 +6,3 @@ # co-rethinkdb

[![NPM](http://img.shields.io/npm/v/co-rethinkdb.svg?style=flat)](https://npmjs.org/package/co-rethinkdb)
[![Dependency Status](http://img.shields.io/gemnasium/rkusa/co-rethinkdb.svg?style=flat)](https://david-dm.org/rkusa/co-rethinkdb)
[![Dependency Status](http://img.shields.io/david/rkusa/co-rethinkdb.svg?style=flat)](https://david-dm.org/rkusa/co-rethinkdb)

@@ -67,2 +67,33 @@ With [RethinkDB 1.13](http://rethinkdb.com/blog/1.13-release/) the official JavaScript driver supports Promises. Since `co` supports Promises directly, a wrapper is not required anymore. However, `co-rethinkdb` still supports some API goodness by not having to call `.run()` all the time.

### Load Balancer
The counterpart to `r.getConnection()` is `r.releaseConnection()`. This can be used to plug in a load balancer, e.g.:
```js
var Pool = require('jacuzzi').Pool
var r = require('co-rethinkdb')
r.getConnection = function*() {
return yield pool.acquire.bind(pool)
}
r.releaseConnection = function*(conn) {
pool.release(conn)
}
var pool = new Pool({
create: function(callback) {
r.connect({ db: 'tdengine' })
.then(function(conn) { callback(null, conn) })
.catch(callback)
},
destroy: function(conn, callback) {
conn.close(callback)
},
check: function(conn) {
return conn.open === true
}
})
```
## MIT License

@@ -69,0 +100,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc