{"_id":"common-pool","_rev":"11-efe69306f70689efbb481bfb0f38a57e","name":"common-pool","description":"Simple resource pool","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"common-pool","version":"0.1.0","description":"Simple resource pool","keywords":["pool"],"author":{"name":"Vadim M. Baryshev","email":"vadimbaryshev@gmail.com"},"repository":{"type":"git","url":"git://github.com/baryshev/common-pool.git"},"main":"index","engines":{"node":">= 0.2.0"},"_npmJsonOpts":{"file":"/home/vadim/.npm/common-pool/0.1.0/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"common-pool@0.1.0","dependencies":{},"devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.22","_nodeVersion":"v0.4.10","_defaultsLoaded":true,"dist":{"shasum":"72913eee97c92fd760a1163829e4c85d1e43e817","tarball":"https://registry.npmjs.org/common-pool/-/common-pool-0.1.0.tgz","integrity":"sha512-mz0wqMRD/cj62EPeU5mXwD6ZAROui2HSPedzPQvNdd+4zkDm1GC8NgEYRporgxMqMxBfCT51JJJA78/btGFyuw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAv+bOICrRIxRz6cBzWwnmGHw1DiFbmQFcCbPkP3xyTPAiB+DOY5DaRgUxjHcvNB/yI35pL1Sp1zJDYdyOXUAMs7jQ=="}]},"scripts":{},"maintainers":[{"name":"baryshev","email":"vadimbaryshev@gmail.com"}]},"0.1.1":{"name":"common-pool","version":"0.1.1","description":"Simple resource pool","keywords":["pool"],"author":{"name":"Vadim M. Baryshev","email":"vadimbaryshev@gmail.com"},"repository":{"type":"git","url":"git://github.com/baryshev/common-pool.git"},"main":"index","engines":{"node":">= 0.2.0"},"_npmJsonOpts":{"file":"/home/vadim/.npm/common-pool/0.1.1/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"common-pool@0.1.1","dependencies":{},"devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.22","_nodeVersion":"v0.4.10","_defaultsLoaded":true,"dist":{"shasum":"d1d4d3f44f283d05f30183d760fe8872e9f307ff","tarball":"https://registry.npmjs.org/common-pool/-/common-pool-0.1.1.tgz","integrity":"sha512-9gLYHXf73hGdex8bj3QP3gtRhPlldK0WltdkKThY+dXZkY+A4pk/6ZNrxAZVEyuXtftkysZ/oHDxAea1ht4t/g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHUTPrLVoi5UhOs2zd7AYWTY9bDjAB/TVVO0ok+VrIwIAiEAz3mlACrfFXxxTa/Mv2Ef9Q6q+PcBaaCuAiUr/opcB6s="}]},"scripts":{},"maintainers":[{"name":"baryshev","email":"vadimbaryshev@gmail.com"}]},"0.2.0":{"name":"common-pool","version":"0.2.0","description":"Simple resource pool","keywords":["pool"],"author":{"name":"Vadim M. Baryshev","email":"vadimbaryshev@gmail.com"},"repository":{"type":"git","url":"https://github.com/baryshev/common-pool.git"},"main":"index","engines":{"node":">= 0.2.0"},"readme":"[![build status](https://secure.travis-ci.org/baryshev/common-pool.png)](http://travis-ci.org/baryshev/common-pool)\n# About \nSimple resource pool.\n\n# Installation\n\n\tnpm install common-pool\n\n# Example\n\n```js\nvar pool = require(\"common-pool\");\nvar resourceCreate = function(callback) {\n\tsomeResource.create(function(error, resource) {\n\t\tcallback(error, resource);\n\t});\n};\n\nvar resourceDestroy = function(resource) {\n\tresource.destroy();\n};\n\nvar maxPoolSize = 10;\nvar idleTimeout = 3600 * 1000;\nvar idleInterval = 30000; // Optional, 10000 by default\n\nvar resources = pool(resourceCreate, resourceDestroy, maxPoolSize, idleTimeout, idleInterval);\n\nresources.take(function(error, resource) {\n\tif (error) {\n\t\t// Oh no!\n\t\t// Resource could not be created.\n\t} else {\n\t\t// Start working with resource.\n\t\tresource.doSomething(function(error) {\n\t\t\tif (error) {\n\t\t\t\t// Something wrong!\n\t\t\t\t// This is bad resource. Removing it from pool.\n\t\t\t\tresources.remove(resource);\n\t\t\t} else {\n\t\t\t\t// Action complete.\n\t\t\t\t// Returning resource to pool.\n\t\t\t\tresource.release(resource);\n\t\t\t}\n\t\t});\n\t}\n});\n```","_id":"common-pool@0.2.0","dist":{"shasum":"c22a59ab6e841dd5f413a71f6f6029499cc2b9fd","tarball":"https://registry.npmjs.org/common-pool/-/common-pool-0.2.0.tgz","integrity":"sha512-/xjgAnfZ20uvsJFRYD+2RnfVSbxFExiuM5t1okQe7Jx+Ge8WmQHoQ5PZz0naE9cTTIkLFg83IyC+Z2d89a57Vw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDct1MpVbEyF2/z49cIAYjb9glbzH7zaT+8z9MHAvRUXgIhAIl9q/yi/eynTtR/+2p7GVh0cLlFsEi2qKv9NVaF/lmR"}]},"maintainers":[{"name":"baryshev","email":"vadimbaryshev@gmail.com"}]}},"maintainers":[{"name":"baryshev","email":"vadimbaryshev@gmail.com"}],"time":{"modified":"2022-06-13T06:35:53.160Z","created":"2011-09-17T14:20:43.878Z","0.1.0":"2011-09-17T14:20:46.217Z","0.1.1":"2011-09-17T14:47:53.163Z","0.2.0":"2012-09-05T07:01:03.769Z"},"author":{"name":"Vadim M. Baryshev","email":"vadimbaryshev@gmail.com"},"repository":{"type":"git","url":"https://github.com/baryshev/common-pool.git"},"users":{"jimmykuo":true,"felixfbecker":true}}