{"_id":"node-gearman","_rev":"22-054fb0837182d20b46653725a585bf5f","name":"node-gearman","description":"Simple Gearman client/worker module for Node.JS","dist-tags":{"latest":"0.2.2"},"versions":{"0.1.0":{"name":"node-gearman","description":"Simple Gearman client/worker module for Node.JS","version":"0.1.0","author":{"name":"Andris Reinman"},"maintainers":[{"name":"andris","email":"andris@node.ee"}],"homepage":"http://github.com/andris9/gearman","repository":{"type":"git","url":"git://github.com/andris9/gearman.git"},"main":"./lib/gearman","licenses":[{"type":"MIT","url":"http://github.com/andris9/gearman/blob/master/LICENSE"}],"engine":["node >=0.5.0"],"keywords":["gearman","worker","message queue"],"_npmUser":{"name":"andris","email":"andris@node.ee"},"_id":"node-gearman@0.1.0","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"97bbd17b10a361cfe8e89b2c6f1ffa648f88bd96","tarball":"https://registry.npmjs.org/node-gearman/-/node-gearman-0.1.0.tgz","integrity":"sha512-NKszVLUrG4WTUT6CfBS7kBX1xAYu+x63CA2yCKfb+LoHd89BjpjeuW2IPzZEelItDrh125viA12f+6PCtK4sKw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEbMpwm/E0TActSC6oNwD8i+xScMeeTAmDPRrVudjgaHAiAt86VDueDMYmCb4oX5v8tfoJxOVDn8MTYGVrk371gtvQ=="}]}},"0.1.1":{"name":"node-gearman","description":"Simple Gearman client/worker module for Node.JS","version":"0.1.1","author":{"name":"Andris Reinman"},"maintainers":[{"name":"andris","email":"andris@node.ee"}],"homepage":"http://github.com/andris9/gearman","repository":{"type":"git","url":"git://github.com/andris9/gearman.git"},"main":"./lib/gearman","licenses":[{"type":"MIT","url":"http://github.com/andris9/gearman/blob/master/LICENSE"}],"engine":["node >=0.5.0"],"keywords":["gearman","worker","message queue"],"_npmUser":{"name":"andris","email":"andris@node.ee"},"_id":"node-gearman@0.1.1","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"3cf9078f1b898dff229ea78fc2ea033a9d2ad83f","tarball":"https://registry.npmjs.org/node-gearman/-/node-gearman-0.1.1.tgz","integrity":"sha512-g1B8uU5a814uIyUuUlmMOwE94TCJF/3WnnoupxyC1Tt8KPmNvukN+opaNrr3qoAyUKqCHL0tG6ByCL10N+a3qA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDvJDFT4qpGm93ZU6l15xxtSbqsIXuU8CiOhVrbOCr9WwIgAl/P6Xts7EWWi+sxiRs9IXL1f7idXazWMYV6vgutuT8="}]}},"0.1.2":{"name":"node-gearman","description":"Simple Gearman client/worker module for Node.JS","version":"0.1.2","author":{"name":"Andris Reinman"},"maintainers":[{"name":"andris","email":"andris@node.ee"}],"homepage":"http://github.com/andris9/gearman","repository":{"type":"git","url":"git://github.com/andris9/gearman.git"},"main":"./lib/gearman","licenses":[{"type":"MIT","url":"http://github.com/andris9/gearman/blob/master/LICENSE"}],"engine":["node >=0.5.0"],"keywords":["gearman","worker","message queue"],"_npmUser":{"name":"andris","email":"andris@node.ee"},"_id":"node-gearman@0.1.2","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"ab9e78342512f71d794f27ae94bd4f741a31f4a8","tarball":"https://registry.npmjs.org/node-gearman/-/node-gearman-0.1.2.tgz","integrity":"sha512-GgIGxijgoU6kkfMKOnkX/xr3JH/0Rr+vgjh78xwywe1hsvlKSULbrzUOMKavrPJPEo7w7BsTDraMY1VplJu+2A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCj8PtfPWXeHeyQWes5+7+VbwN8/E64pbAp7fOHOmQdkwIhAOYxabvLUqHYHbLuqNBp4UNyKrMF5kpj5KJJlEE8zy52"}]}},"0.1.3":{"name":"node-gearman","description":"Simple Gearman client/worker module for Node.JS","version":"0.1.3","author":{"name":"Andris Reinman"},"maintainers":[{"name":"andris","email":"andris@node.ee"}],"homepage":"http://github.com/andris9/gearman","repository":{"type":"git","url":"git://github.com/andris9/gearman.git"},"main":"./lib/gearman","licenses":[{"type":"MIT","url":"http://github.com/andris9/gearman/blob/master/LICENSE"}],"engine":["node >=0.5.0"],"keywords":["gearman","worker","message queue"],"_npmUser":{"name":"andris","email":"andris@node.ee"},"_id":"node-gearman@0.1.3","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"b7430cffc75f3920232dcf7dd1369d62f7a8f561","tarball":"https://registry.npmjs.org/node-gearman/-/node-gearman-0.1.3.tgz","integrity":"sha512-dkJeQtb6ml93QZID3B+L85Id1M7owhgoclGTLJMjWdbPkJ9MQLgEH6MjE/9rIyrCUUo/QAbHWH5eWAamXSxFaA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCc6km2RExriN05l36AFNGMDtadCWEI1GGO65SYfzXuaAIhAP2bS19m9U+CDOSHRASDIumlRLZGgM2bkoPH8dWTCg4a"}]}},"0.1.4":{"name":"node-gearman","description":"Simple Gearman client/worker module for Node.JS","version":"0.1.4","author":{"name":"Andris Reinman"},"maintainers":[{"name":"andris","email":"andris@node.ee"}],"homepage":"http://github.com/andris9/gearman","repository":{"type":"git","url":"git://github.com/andris9/gearman.git"},"main":"./lib/gearman","licenses":[{"type":"MIT","url":"http://github.com/andris9/gearman/blob/master/LICENSE"}],"engine":["node >=0.5.0"],"keywords":["gearman","worker","message queue"],"_npmUser":{"name":"andris","email":"andris@node.ee"},"_id":"node-gearman@0.1.4","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-alpha-6","_nodeVersion":"v0.6.5","_defaultsLoaded":true,"dist":{"shasum":"6d3d8e5ba81026e8e0237ff7b046d9ded266a814","tarball":"https://registry.npmjs.org/node-gearman/-/node-gearman-0.1.4.tgz","integrity":"sha512-mGP1VLvtbDvGLiCOrbUrFJxS5xF2DQd98SB5oWWqvmhOicyA5PRgi5eOSRS6hrJCgMUbJ3+RJ55yEvVrfjVGuQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA6gbmLFs79Jcnp3CYW6TOQlWcYg2pNzT88OpFtpPZyfAiAjHA/rp8TLjGYkRAnU4lrdQu2wA9+Z5it6snCO5Jeo2A=="}]}},"0.1.5":{"name":"node-gearman","description":"Simple Gearman client/worker module for Node.JS","version":"0.1.5","author":{"name":"Andris Reinman"},"maintainers":[{"name":"andris","email":"andris@node.ee"}],"homepage":"http://github.com/andris9/gearman","repository":{"type":"git","url":"git://github.com/andris9/gearman.git"},"main":"./lib/gearman","licenses":[{"type":"MIT","url":"http://github.com/andris9/gearman/blob/master/LICENSE"}],"engine":["node >=0.5.0"],"keywords":["gearman","worker","message queue"],"_npmUser":{"name":"andris","email":"andris@node.ee"},"_id":"node-gearman@0.1.5","dependencies":{},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-2","_nodeVersion":"v0.6.8","_defaultsLoaded":true,"dist":{"shasum":"83ec01f9e8fc3e8231c4caa1ffbfffa200ce5a5a","tarball":"https://registry.npmjs.org/node-gearman/-/node-gearman-0.1.5.tgz","integrity":"sha512-cRDrrmUkX3ab5C510Ms7d57C+ygyQ9W4AskdcWN9freBdDpSY8FgeK5sVhFqgZM9oDf97OW2LIozgQU4ADbSxQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDMWqUNMaPS9vM6OnD5PdpZccuaIreg0EqAgYuNa95JxwIgUmz8cBPv0V0NO20kj2e8CmMuivFtk430uwuSj6ehlnQ="}]}},"0.2.0":{"name":"node-gearman","description":"Simple Gearman client/worker module for Node.JS","version":"0.2.0","author":{"name":"Andris Reinman"},"maintainers":[{"name":"andris","email":"andris@node.ee"}],"homepage":"http://github.com/andris9/gearman","repository":{"type":"git","url":"git://github.com/andris9/gearman.git"},"scripts":{"test":"node ./run_tests.js"},"devDependencies":{"nodeunit":"*"},"main":"./lib/gearman","licenses":[{"type":"MIT","url":"http://github.com/andris9/gearman/blob/master/LICENSE"}],"engine":{"node":">=0.5"},"keywords":["gearman","worker","message queue"],"_npmUser":{"name":"andris","email":"andris@node.ee"},"_id":"node-gearman@0.2.0","dependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.10","_defaultsLoaded":true,"dist":{"shasum":"dbdbbb3280fdf8d077ebb37a9d7ddf72c0b912f3","tarball":"https://registry.npmjs.org/node-gearman/-/node-gearman-0.2.0.tgz","integrity":"sha512-ACb7ZMmGQPxmrANjhvTLFkf6hAVUomMmANnN/Yk+DGLmkzWr215mNTkAKXDa2Yd4dwLES1BsK5MHNPbX3qL7Jg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGIBUcAeaLdxs2Op6+t3Wm0IeRfDV/xXkReLPzYiMewjAiEA7TTxD6jbpLI0mqIU8e5PIbggyUghk4iuaVo/EUMYrws="}]}},"0.2.1":{"name":"node-gearman","description":"Simple Gearman client/worker module for Node.JS","version":"0.2.1","author":{"name":"Andris Reinman"},"maintainers":[{"name":"andris","email":"andris@node.ee"}],"homepage":"http://github.com/andris9/gearman","repository":{"type":"git","url":"git://github.com/andris9/gearman.git"},"scripts":{"test":"node ./run_tests.js"},"devDependencies":{"nodeunit":"*"},"main":"./lib/gearman","licenses":[{"type":"MIT","url":"http://github.com/andris9/gearman/blob/master/LICENSE"}],"engine":{"node":">=0.5"},"keywords":["gearman","worker","message queue"],"_npmUser":{"name":"andris","email":"andris@node.ee"},"_id":"node-gearman@0.2.1","dependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.10","_defaultsLoaded":true,"dist":{"shasum":"ee5567877cce3ce042d82069e6e3db1062293930","tarball":"https://registry.npmjs.org/node-gearman/-/node-gearman-0.2.1.tgz","integrity":"sha512-fCLNoEMNMsGXyzy2uZkLryzb9Pf9z+ZL2y/IIGGWFB2kUBAkezxgIa/bHfNlHqEvQqrAFuHf1MRMCbG8Gqro/w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG9MohmdtnfgAxy1VfHmePKWLjgsD2NfUI5+euL3+7FlAiEAzcuY/1lvRjcBb6Rp5OreT1z6FGxxaA9ZXEbnWWlP4Tw="}]}},"0.2.2":{"name":"node-gearman","description":"Simple Gearman client/worker module for Node.JS","version":"0.2.2","author":{"name":"Andris Reinman"},"maintainers":[{"name":"andris","email":"andris@node.ee"}],"homepage":"http://github.com/andris9/node-gearman","repository":{"type":"git","url":"http://github.com/andris9/node-gearman.git"},"scripts":{"test":"node ./run_tests.js"},"devDependencies":{"nodeunit":"*"},"main":"./lib/gearman","licenses":[{"type":"MIT","url":"http://github.com/andris9/gearman/blob/master/LICENSE"}],"engine":{"node":">=0.5"},"keywords":["gearman","worker","message queue"],"readme":"# node-gearman\n\n**node-gearman** is an extremely simple Gearman client/worker module for Node.JS. You can register workers and you can submit jobs, that's all about it.\n\n[![Build Status](https://secure.travis-ci.org/andris9/node-gearman.png)](http://travis-ci.org/andris9/node-gearman)\n\n**NB!** Breaking API change - `'connected'` events etc are now called `'connect'`.\n\n## Support node-gearman development\n\n[![Donate to author](https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=DB26KWR2BQX5W)\n\n## Installation\n\nInstall through *npm*\n\n    npm install node-gearman\n\n## Usage\n\nSee [examples](https://github.com/andris9/node-gearman/tree/master/examples) folder for sample scripts\n\n## Connect to a Gearman server\n\nSet up connection data and create a new `Gearman` object\n\n    var Gearman = require(\"node-gearman\");\n    var gearman = new Gearman(hostname, port);\n\nWhere `hostname` defaults to `\"localhost\"` and `port` to `4730`\n\nThis doesn't actually create the connection yet. Connection is created when needed but you can force it with `gearman.connect()`\n\n    var gearman = new Gearman(hostname, port);\n    gearman.connect();\n\n## Connection events\n\nThe following events can be listened for a `Gearman` object:\n\n  * **connect** - when the connection has been successfully established to the server\n  * **idle** - when there's no jobs available for workers\n  * **close** - connection closed\n  * **error** - an error occured. Connection is automatically closed.\n\nExample:\n\n    var gearman = new Gearman(hostname, port);\n    gearman.on(\"connect\", function(){\n        console.log(\"Connected to the server!\");\n    });\n    gearman.connect();\n\n## Submit a Job\n\nJobs can be submitted with `gearman.submitJob(name, payload)` where `name` is the name of the function and `payload` is a string or a Buffer. The returned object (Event Emitter) can be used to detect job status and has the following events:\n\n  * **error** - if the job failed, has parameter error\n  * **data** - contains a chunk of data as a Buffer\n  * **end** - when the job has been completed, has no parameters\n  * **timeout** - when the job has been canceled due to timeout\n\nExample:\n\n    var gearman = new Gearman(hostname, port);\n    var job = gearman.submitJob(\"reverse\", \"test string\");\n\n    job.on(\"data\", function(data){\n        console.log(data.toString(\"utf-8\")); // gnirts tset\n    });\n\n    job.on(\"end\", function(){\n        console.log(\"Job completed!\");\n    });\n\n    job.on(\"error\", function(error){\n        console.log(error.message);\n    });\n\n## Setup a Worker\n\nWorkers can be set up with `gearman.registerWorker(name, callback)` where `name` is the name of the function and `callback` is the function to be run when a job is received.\n\nWorker function `callback` gets two parameters - `payload` (received data as a Buffer) and `worker` which is a helper object to communicate with the server. `worker` object has following methods:\n\n  * **write(data)** - for sending data chunks to the client\n  * **end([data])** for completing the job\n  * **error()** to indicate that the job failed\n\nExample:\n\n    var gearman = new Gearman(hostname, port);\n\n    gearman.registerWorker(\"reverse\", function(payload, worker){\n        if(!payload){\n            worker.error();\n            return;\n        }\n        var reversed = payload.toString(\"utf-8\").split(\"\").reverse().join(\"\");\n        worker.end(reversed);\n    });\n\n## Job timeout\n\nYou can set an optional timeout value (in milliseconds) for a job to abort it automatically when the timeout occurs.\n\nTimeout automatically aborts further processing of the job.\n\n    job.setTimeout(timeout[, timeoutCallback]);\n\nIf `timeoutCallback` is not set, a `'timeout'` event is emitted on timeout.\n\n    job.setTimeout(10*1000); // timeout in 10 secs\n    job.on(\"timeout\", function(){\n        console.log(\"Timeout exceeded for the worker. Job aborted.\");\n    }); \n\n## Close connection\n\nYou can close the Geamrna connection with `close()`\n\n    var gearman = new Gearman();\n    ...\n    gearman.close();\n\nThe connection is closed when a `'close'` event for the Gearman object is emitted\n\n    gearman.on(\"close\", function(){\n        console.log(\"Connection closed\");\n    });\n    \n    gearman.close();\n\n## Streaming\n\nWorker and job objects also act as Stream objects (workers are writable and jobs readable streams), so you can stream data with `pipe` from a worker to a client (but not the other way round). This is useful for zipping/unzipping etc.\n\n**NB!** Streaming support is experimental, do not send very large files as the data tends to clutter up (workers stream interface lacks support for pausing etc.).\n\n**Streaming worker**\n\n    gearman.registerWorker(\"stream_file\", function(payload, worker){\n        var input = fs.createReadStream(filepath);\n        // stream file to client\n        input.pipe(worker);\n    });\n\n**Streaming client**\n\n    var job = gearman.submitJob(\"stream\", null),\n        output = fs.createWriteStream(filepath); \n    \n    // save incoming stream to file\n    job.pipe(output);\n\n## Run tests\n\nRun the tests with\n\n    npm test\n    \nor alternatively\n\n    node run_tests.js\n## License\n\n**MIT**","readmeFilename":"README.md","_id":"node-gearman@0.2.2","dist":{"shasum":"ace212787c905c3edf5457a83206596ff871b074","tarball":"https://registry.npmjs.org/node-gearman/-/node-gearman-0.2.2.tgz","integrity":"sha512-O/qJ1WL+u0tdP56zMIFje+y/rb78Y9BQN7CutpaUNAVWnPjIJPpY7YWyNz/OdS3iNUHVghjCUsmAtHR8fHjNAg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDqGWSY/509GGoUsARFVVKWtbMsZkvJE2GaoBESKoywFAIgPmMwjUHo3eqVYRUYH2xkAws9YZJzfyKNY9NvciEDeTk="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"andris","email":"andris@node.ee"}}},"readme":"# node-gearman\n\n**node-gearman** is an extremely simple Gearman client/worker module for Node.JS. You can register workers and you can submit jobs, that's all about it.\n\n## Installation\n\nInstall through *npm*\n\n    npm install node-gearman\n\n## Usage\n\n## Connect to a Gearman server\n\nSet up connection data and create a new `Gearman` object\n\n    var Gearman = require(\"node-gearman\");\n    \n    var gearman = new Gearman(hostname, port);\n\nWhere `hostname` defaults to `\"localhost\"` and `port` to `4730`\n\nThis doesn't actually create the connection yet. Connection is created when needed but you can force it with `gearman.connect()`\n\n    var gearman = Gearman(hostname, port);\n    gearman.connect();\n\n## Connection events\n\nThe following events can be listened for a `Gearman` object:\n\n  * **connected** - when the connection has been successfully established to the server\n  * **idle** - when a there's no jobs available for workers\n  * **close** - connection closed\n  * **error** - an error occured. Connection is automatically closed.\n\n## Submit a Job\n\nJobs can be submitted with `gearman.submitJob(name, payload)` where `name` is the name of the function and `payload` is a string or a Buffer. The returned object (Event Emitter) can be used to detect job status and has the following events:\n\n  * **error** - if the job failed, has parameter error\n  * **data** - contains a chunk of data as a Buffer\n  * **end** - when the job has been completed, has no parameters\n\nExample:\n\n    var gearman = Gearman(hostname, port);\n    var job = gearman.submitJob(\"reverse\", \"test string\");\n\n    job.on(\"data\", function(data){\n        console.log(data.toString(\"utf-8\")); // gnirts tset\n    });\n\n    job.on(\"end\", function(){\n        console.log(\"Job completed!\");\n    });\n\n    job.on(\"error\", function(error){\n        console.log(error.message);\n    });\n\n## Setup a Worker\n\nWorkers can be set up with `gearman.registerWorker(name, callback)` where `name` is the name of the function and `callback` is the function to be run when a job is received.\n\nWorker function `callback` gets two parameters - `payload` (received data as a Buffer) and `worker` which is a helper object to communicate with the server. `worker` object has following methods:\n\n  * **write(data)** - for sending data chunks to the client\n  * **end([data])** for completing the job\n  * **error()** to indicate that the job failed\n\nExample:\n\n    var gearman = Gearman(hostname, port);\n\n    gearman.registerWorker(\"reverse\", function(payload, worker){\n        if(!payload){\n            return worker.error();\n        }\n        var reversed = payload.toString(\"utf-8\").split(\"\").reverse().join(\"\");\n        worker.end(reversed);\n    });\n\n## License\n\n**MIT**","maintainers":[{"name":"andris","email":"andris@node.ee"}],"time":{"modified":"2022-06-21T15:01:03.839Z","created":"2011-11-23T10:22:06.072Z","0.1.0":"2011-11-23T10:22:07.995Z","0.1.1":"2011-11-23T13:20:16.117Z","0.1.2":"2011-11-28T08:54:38.882Z","0.1.3":"2011-11-28T09:30:28.900Z","0.1.4":"2011-12-09T14:49:29.443Z","0.1.5":"2012-01-25T14:20:58.259Z","0.2.0":"2012-02-13T13:16:59.059Z","0.2.1":"2012-02-16T10:12:00.738Z","0.2.2":"2013-08-21T06:55:17.479Z"},"author":{"name":"Andris Reinman"},"repository":{"type":"git","url":"http://github.com/andris9/node-gearman.git"},"users":{"anticom":true}}