{"_id":"node-queue-lib","_rev":"86-541c0175671b79e632eafe7e402b86ec","name":"node-queue-lib","time":{"modified":"2022-06-21T18:31:16.576Z","created":"2014-05-15T20:20:00.870Z","0.0.1":"2014-05-15T20:20:00.870Z","0.0.2":"2014-05-15T20:28:35.811Z","0.0.3":"2014-05-15T20:48:11.738Z","0.0.4":"2014-05-16T19:23:58.528Z","0.0.5":"2014-05-16T19:36:41.589Z","0.0.6":"2014-05-16T19:42:31.690Z","0.0.7":"2014-05-16T19:47:20.608Z","0.0.8":"2014-05-18T18:09:13.758Z","0.0.9":"2014-05-18T18:18:47.120Z","0.0.10":"2014-05-18T18:29:23.175Z","0.0.11":"2014-05-18T18:49:11.533Z","0.0.12":"2014-05-18T18:56:08.430Z","0.0.13":"2014-05-18T19:06:58.235Z","0.0.14":"2014-05-18T20:42:18.424Z","0.0.15":"2014-05-18T20:49:22.582Z","0.0.16":"2014-05-18T20:55:58.390Z","0.0.17":"2014-05-18T22:34:37.813Z","0.0.18":"2014-05-19T17:35:51.246Z","0.0.19":"2014-05-20T19:41:29.043Z","0.0.20":"2014-05-21T23:01:37.662Z","0.0.21":"2014-05-21T23:08:33.724Z","0.0.22":"2014-05-22T22:47:12.343Z","0.0.23":"2014-05-22T22:55:24.070Z","0.0.24":"2014-05-22T23:05:16.357Z","0.0.25":"2014-05-23T21:08:47.462Z","0.0.26":"2014-05-23T21:12:38.790Z","0.0.27":"2014-05-24T09:49:41.686Z","0.0.28":"2014-11-13T23:25:19.709Z"},"maintainers":[{"name":"andygrom","email":"andygromrus@gmail.com"}],"dist-tags":{"latest":"0.0.28"},"description":"Javascript implementation of message queue with various delivery strategy","readme":"The javascript message queue implementation\r\n===========================================\r\nJavascript implementation of message queue with various delivery strategy.\r\n\r\nFeatures\r\n--------\r\n1. Round-robin and broadcast message delivery strategy.\r\n2. Various usages:\r\n\t* Into same node.js process.\r\n\t* Inter process.\r\n\t* Inter platform (node.js and browser).\r\n\r\nInstallation\r\n------------\r\n\r\n```bash\r\nnpm install node-queue-lib\r\n```\r\n\r\nSimple Usages\r\n-------------\r\n\r\n[see example](https://github.com/AndyGrom/node-message-queue/blob/master/examples/core.js)\r\n```javascript\r\nvar Queue = require('node-queue-lib/queue.core');\r\n\r\nvar queue = new Queue('Queue name', 'broadcast');\r\n\r\n// subscribe on 'Queue name' messages\r\nqueue.subscribe(function (err, subscriber) {\r\n    subscriber.on('error', function(err){\r\n        //\r\n    });\r\n    subscriber.on('data', function (data, accept) {\r\n        console.log(data);\r\n        accept(); // accept process message\r\n    });\r\n});\r\n\r\n// publish message\r\nqueue.publish('test');\r\n```\r\n\r\nInter process usages\r\n--------------------\r\n\r\nserver message queue:\r\n\r\n[see example](https://github.com/AndyGrom/node-message-queue/blob/master/examples/server.js)\r\n```javascript\r\nvar SocketIoBridgeServer = require('node-queue-lib/lib/net/socket-io-bridge-server');\r\nvar QueueServer = require('node-queue-lib/lib/core/node-queue-server');\r\nvar http = require('http');\r\n\r\n// TCP port for incoming connections\r\nvar port = 80;\r\n\r\n// Create Socket.IO transport bridge\r\nvar serverBridge = new SocketIoBridgeServer(port, function() {\r\n\t// return http server instance\r\n\treturn http.createServer();\r\n});\r\n\r\n// Create server and start listening\r\nvar server = new QueueServer( { serverBridge : serverBridge } );\r\n```\r\n\r\n\r\nclient:\r\n[see example](https://github.com/AndyGrom/node-message-queue/blob/master/examples/client.js)\r\n```javascript\r\nvar Queue = require('node-queue-lib');\r\n\r\nvar url = 'http://localhost';\r\n\r\n// create queue instance\r\nvar queue = new Queue( url, 'test-queue', 'broadcast' );\r\n\r\n// subscribe on 'Queue name' messages\r\nqueue.subscribe(function (subscriber) {\r\n    subscriber.on('error', function(err){\r\n        //\r\n    });\r\n\tsubscriber.on('data', function (data, accept) {\r\n\t\tconsole.log(data);\r\n\t\taccept(); // accept process message\r\n\t});\r\n});\r\n\r\n// publish message\r\nqueue.publish('test');\r\n```\r\n\r\nInter platform usages\r\n---------------------\r\nThe server code is the same as above.\r\n\r\nclient:\r\n[see example](https://github.com/AndyGrom/node-message-queue/blob/master/examples/client.html)\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n<head>\r\n    <title>message queue example</title>\r\n\r\n    <script src=\"queue.client.js\"></script>\r\n\r\n    <script>\r\n        (function(){\r\n            var url = 'http://localhost';\r\n\r\n            // create queue instance\r\n            var queue = new queuelib.Queue( url, 'test-queue', 'broadcast' );\r\n\r\n            // subscribe on 'Queue name' messages\r\n            queue.subscribe(function (err, subscriber) {\r\n                subscriber.on('error', function(err){\r\n                    //\r\n                });\r\n                subscriber.on('data', function (data, accept) {\r\n                    document.write(data);\r\n                    accept(); // accept process message\r\n                });\r\n            });\r\n\r\n            // publish message\r\n            queue.publish('test');\r\n        })();\r\n    </script>\r\n</head>\r\n<body>\r\n\r\n</body>\r\n</html>\r\n```\r\n\r\nReview examples\r\n---------------\r\n\r\n```bash\r\nnpm install node-queue-lib\r\ncd ./node_modules/node-queue-lib/examples\r\n```\r\n\r\nrun core test:\r\n```bash\r\nnode core.js\r\n```\r\n\r\nrun client-server test:\r\n```bash\r\nnode server.js\r\n```\r\n```bash\r\nnode client.js\r\n```\r\n\r\nFor run browser test locate you browser to http://localhost:8888\r\n\r\nRun tests\r\n---------\r\n\r\nFor run tests you must have installed [grunt](http://gruntjs.com/).\r\n\r\n```bash\r\ngrunt test\r\n```\r\n\r\nLicense\r\n-------\r\nThe MIT License\r\n\r\nCopyright (c) 2014 Gromozdov Andrey Alexandrovich.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the \"Software\"), to deal\r\nin the Software without restriction, including without limitation the rights\r\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software, and to permit persons to whom the Software is\r\nfurnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in\r\nall copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r\nTHE SOFTWARE.\r\n","versions":{"0.0.27":{"name":"node-queue-lib","description":"Javascript implementation of message queue with various delivery strategy","version":"0.0.27","author":{"name":"Gromozdov Andrey Alexandrovich"},"main":"lib/queue.client.js","repository":{"type":"git","url":"git://github.com/AndyGrom/node-message-queue.git"},"licenses":[{"type":"MIT","url":"https://github.com/AndyGrom/node-message-queue/blob/master/LICENSE.TXT"}],"keywords":["message","queue"],"dependencies":{"socket.io-client":"^0.9.16","socket.io":"^0.9.16","node-uuid":"^1.4.1"},"engines":{"node":">= 0.10.0"},"devDependencies":{"grunt":"^0.4.4","grunt-contrib-jshint":"^0.10.0","grunt-contrib-uglify":"^0.4.0","browserify":"^3.46.0","grunt-browserify":"^2.0.8","grunt-jasmine-node":"^0.2.1","grunt-jasmine-node-coverage":"^0.1.10","mime":"^1.2.11","phantomjs":"^1.9.7-5","colors":"^0.6.2","grunt-markdown":"^0.5.0"},"homepage":"https://github.com/AndyGrom/node-message-queue","scripts":{},"bugs":{"url":"https://github.com/AndyGrom/node-message-queue/issues"},"_id":"node-queue-lib@0.0.27","dist":{"shasum":"d2f577d3d31791490aeb7f72169462be06827f23","tarball":"https://registry.npmjs.org/node-queue-lib/-/node-queue-lib-0.0.27.tgz","integrity":"sha512-MycbGXcmhfXN7IYr+OdTNZT9j2h0vHBxUZu9szLYTiJTKj1wchrkT66RsuC+QF9DBXtYcFkkhAMla70XGXV4uA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAdunvNsnM0IXwDZIgp0sF8d7VzGqeV6O60l2k2NHtOSAiEA47FN2OHzaDr3DtY3KY21UQeKUpg0rGsxoqbbqOP2H2Y="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"andygrom","email":"andygromrus@gmail.com"},"maintainers":[{"name":"andygrom","email":"andygromrus@gmail.com"}]},"0.0.28":{"name":"node-queue-lib","description":"Javascript implementation of message queue with various delivery strategy","version":"0.0.28","author":{"name":"Gromozdov Andrey Alexandrovich"},"main":"lib/queue.client.js","repository":{"type":"git","url":"git://github.com/AndyGrom/node-message-queue.git"},"licenses":[{"type":"MIT","url":"https://github.com/AndyGrom/node-message-queue/blob/master/LICENSE.TXT"}],"keywords":["message","queue"],"dependencies":{"socket.io-client":"^0.9.16","socket.io":"^0.9.16","node-uuid":"^1.4.1"},"engines":{"node":">= 0.10.0"},"devDependencies":{"grunt":"^0.4.4","grunt-contrib-jshint":"^0.10.0","grunt-contrib-uglify":"^0.4.0","browserify":"^3.46.0","grunt-browserify":"^2.0.8","grunt-jasmine-node":"^0.2.1","grunt-jasmine-node-coverage":"^0.1.10","mime":"^1.2.11","phantomjs":"^1.9.7-5","colors":"^0.6.2","grunt-markdown":"^0.5.0"},"homepage":"https://github.com/AndyGrom/node-message-queue","scripts":{},"gitHead":"8ef308eb2893d362d331dc72b79877246b49eb6b","bugs":{"url":"https://github.com/AndyGrom/node-message-queue/issues"},"_id":"node-queue-lib@0.0.28","_shasum":"e0667bc72ee0f59ae0310cfb5c2008cc642c7019","_from":".","_npmVersion":"2.1.3","_nodeVersion":"0.10.31","_npmUser":{"name":"andygrom","email":"andygromrus@gmail.com"},"maintainers":[{"name":"andygrom","email":"andygromrus@gmail.com"}],"dist":{"shasum":"e0667bc72ee0f59ae0310cfb5c2008cc642c7019","tarball":"https://registry.npmjs.org/node-queue-lib/-/node-queue-lib-0.0.28.tgz","integrity":"sha512-MQfg4NpizhkbtnJ/vFGEKzAi/YuhsoyGB3ZmEzPwbRqitKFEb5P4UjaU410DYxwkEUNMpXseGXmc2/L7QpUnAA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA4dK4O+e5Eol+513cc6YobM+Y11GbOBsGAYWv4TDeIBAiABplBfczWl4L/EWswpFLQQro7XLzxFF7DKYbhBUuWWaA=="}]}}},"homepage":"https://github.com/AndyGrom/node-message-queue","keywords":["message","queue"],"repository":{"type":"git","url":"git://github.com/AndyGrom/node-message-queue.git"},"author":{"name":"Gromozdov Andrey Alexandrovich"},"bugs":{"url":"https://github.com/AndyGrom/node-message-queue/issues"},"readmeFilename":"readme.md","users":{"no7david":true}}