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
  });
});

Dependencies (2)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i node-q-pool

    Weekly Downloads

    3

    Version

    12.0.0

    License

    ISC

    Last publish

    Collaborators

    • runvnc