node-q-pool

12.0.0 • Public • Published

The node-q module seems to be losing its connection or for some reason returning undefined from queries after a random amount of time. This goes away when the server is restarted. This is a workaround that creates a pool with new connections every 30 seconds, so there can't be any stale connections that don't work.

Supports k for querying with a connection it from a pool. Also handles ks (without parameters).

var qpool = require('node-q-pool');
 
qpool.getConnection({{host: "localhost", port: 5000}, function(err, con) {
  if (err) throw err;
  con.k("sum 1 2 3", function(err, res) {
    if (err) throw err;
    console.log("result", res); // 6
  });
});

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 12.0.0
    2
    • latest

Version History

Package Sidebar

Install

npm i node-q-pool

Weekly Downloads

3

Version

12.0.0

License

ISC

Last publish

Collaborators

  • runvnc