{"_id":"sink_q","_rev":"31-865f78f420453d1ea9d951382bbf5dd0","name":"sink_q","description":"Queue for holding events until they're ready to be fired","dist-tags":{"latest":"0.0.7"},"versions":{"0.0.1":{"name":"sink_q","version":"0.0.1","description":"Queue for holding events until they're ready to be fired","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git@githubcom:technicalmachine/sink_q.git"},"author":{"name":"Nathan Lintz"},"license":"MIT","_id":"sink_q@0.0.1","dist":{"shasum":"82cf7b1bf633ac39c1a06e751fd6cf384283cad1","tarball":"https://registry.npmjs.org/sink_q/-/sink_q-0.0.1.tgz","integrity":"sha512-G94o4x3+PbUZjxiDOl8t/mE/DaUvtBMWn7p3cjmGfi1kVJYHIuebfpS53thKL6WM92Q0ZR9GyaUvWl3U02fbTQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC2UN+DOHrjWPwyttloJAe0Buz68Fbme4jJYAfOC7AK0QIhAIPqgyMjXuLOPEwQxJodZOM4VxEL4C7+eUaOrJff9ZZz"}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"nlintz","email":"nlintz@gmail.com"},"maintainers":[{"name":"nlintz","email":"nlintz@gmail.com"}]},"0.0.2":{"name":"sink_q","version":"0.0.2","description":"Queue for holding events until they're ready to be fired","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git@githubcom:technicalmachine/sink_q.git"},"author":{"name":"Nathan Lintz"},"license":"MIT","_id":"sink_q@0.0.2","dist":{"shasum":"104af5663a890e87533aea9a61d8c8106cdbaf18","tarball":"https://registry.npmjs.org/sink_q/-/sink_q-0.0.2.tgz","integrity":"sha512-DlkOj3n7luJvNL9CujU5Flw4jbxGpdJnyPsQ6CtDQiKVVltl43p2F4MUTx0UP5qY+KgDqXj0yoXweAd83+3CPA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD7yLmuPqFlOoi8VRT5PXUfcE5kw5p7/EsIWaW+ik+fyAIhALPF3Ev2LKr0a2Cj7OZVUtTGHt8o4OfYvyBVk+OCQQ32"}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"nlintz","email":"nlintz@gmail.com"},"maintainers":[{"name":"nlintz","email":"nlintz@gmail.com"}]},"0.0.3":{"name":"sink_q","version":"0.0.3","description":"Queue for holding events until they're ready to be fired","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git@githubcom:technicalmachine/sink_q.git"},"author":{"name":"Nathan Lintz"},"license":"MIT","_id":"sink_q@0.0.3","dist":{"shasum":"d169a91109fa79f5d28fe2d877ad093b26e38f01","tarball":"https://registry.npmjs.org/sink_q/-/sink_q-0.0.3.tgz","integrity":"sha512-VpEdPAnsqrAOa7HQS2aZSHNpoW38HqXkR2ldJXE1aUbDyWi3cd0jvwXQ5CXWMMxcmio74I4BSr9jmPjzWwQkXQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEZhfaevHCLzYeU/CWlKvUC20phX/xJ0IXSTtEd+GgRzAiAFmGN63VtePQeQf5rzw30DHYvU1VH2UQUq1mWzF1qJ8w=="}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"nlintz","email":"nlintz@gmail.com"},"maintainers":[{"name":"nlintz","email":"nlintz@gmail.com"}]},"0.0.4":{"name":"sink_q","version":"0.0.4","description":"Queue for holding events until they're ready to be fired","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git@githubcom:technicalmachine/sink_q.git"},"author":{"name":"Nathan Lintz"},"license":"MIT","_id":"sink_q@0.0.4","dist":{"shasum":"9f5517738aca733e4c5d3dd7fd9a36339660f563","tarball":"https://registry.npmjs.org/sink_q/-/sink_q-0.0.4.tgz","integrity":"sha512-zuIyyRaFvv0kf5bZoZ6rr6xBiddOD/TEn9pDYQ23iennzpN5Ut/fdEbTR0kmqUuEcT7971mvcJ104WErJNnr7A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDYjT0T03k26Hw6VuDGO9/tAijOFqqg2ZNtBdppwWUtVwIgYBeImzyhLr22EX7/EtwRWbMzz9i4Ap8LvgOQ0S253EE="}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"nlintz","email":"nlintz@gmail.com"},"maintainers":[{"name":"nlintz","email":"nlintz@gmail.com"}]},"0.0.5":{"name":"sink_q","version":"0.0.5","description":"Queue for holding events until they're ready to be fired","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git@githubcom:technicalmachine/sink_q.git"},"author":{"name":"Nathan Lintz"},"license":"MIT","_id":"sink_q@0.0.5","dist":{"shasum":"8d8d82fd5f79aaff64e3314cf88f153346584c88","tarball":"https://registry.npmjs.org/sink_q/-/sink_q-0.0.5.tgz","integrity":"sha512-GZxvqx5IYTeRIis9JZBpeVWWxc0+wSeawHMOtWtkJu8urLR7pNAbR3q/32fyyIssP3J/RFYFGxcELbvOhT/Q6g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDVEQCxlvGMZQAkMd6+Lb3UeiRedMNEMvjSiog2frORFgIgd6Puvx7Is5CP0HVbkVOTJ3kZVpUgNJIDsaKYjvGLweQ="}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"nlintz","email":"nlintz@gmail.com"},"maintainers":[{"name":"nlintz","email":"nlintz@gmail.com"}]},"0.0.6":{"name":"sink_q","version":"0.0.6","description":"Queue for holding events until they're ready to be fired","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git@githubcom:technicalmachine/sink_q.git"},"author":{"name":"Nathan Lintz"},"license":"MIT","_id":"sink_q@0.0.6","dist":{"shasum":"007665de9f375fe7af289ba037d8d5090e709e5b","tarball":"https://registry.npmjs.org/sink_q/-/sink_q-0.0.6.tgz","integrity":"sha512-K33I/Z//4jGaS/ASHlnuI22Z1yXKm26ah8LK5OlSiF6lqpNno6fyTEi0CLyDQyW6N33Fm7TVOLMhvrncMHzphA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDSkurdakUpb0f/U9KyZqWAnQnXQ0LpESwstXOTyIUdtAiBmpAv9UzPQi9yp1FKJHYNQOsoqjAQ87+1NWhHalujAbw=="}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"nlintz","email":"nlintz@gmail.com"},"maintainers":[{"name":"nlintz","email":"nlintz@gmail.com"}]},"0.0.7":{"name":"sink_q","version":"0.0.7","description":"Queue for holding events until they're ready to be fired","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git@githubcom:technicalmachine/sink_q.git"},"author":{"name":"Nathan Lintz"},"license":"MIT","_id":"sink_q@0.0.7","dist":{"shasum":"c9995ef58a13044981e4e3a24de96c172fa97134","tarball":"https://registry.npmjs.org/sink_q/-/sink_q-0.0.7.tgz","integrity":"sha512-SCWQ17tuebzXFY6MUzrYb72siQNfxadTGZqoOsSf13RdzikrbocNU2FPj9Zy6V5W6VetcdbwUuTwEFwgrFQPhw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF7l1wvscqlvQmRjphKuBBHsMLfZYEjTqJKaKoWsCRq6AiEAy4Ji4Xv7kp7pzzqBwJ45oAPSSPU6vOI/sBb+9FnubTI="}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"nlintz","email":"nlintz@gmail.com"},"maintainers":[{"name":"nlintz","email":"nlintz@gmail.com"}]}},"readme":"#sink_q.js\n###Intro\nThis library is used for queuing async functions and flushing the queue when an on ready function is called. For example, if you need to run configuration code before a function can be called, its best to wrap the functions that need configuration in a call to queue.push and call queue.ready when the 'ready' event is emitted. This way, the configuration code will run first and the queue will be flushed automatically when 'ready' fires.\n\nUse this library if you need to run multiple async commands in series and want to store the async calls until after configration code has executed. The queue works by calling each asynchronous after the previous asynchronous function's callback is called.\n\n###How to Use\nRequire the sink_q library\n\n```js\nvar Queue = require(sink_q);\n```\n\nCall lé constructor\n\n```js\nvar myQueue = new Queue();\n```\n\n\nThe two public methods are \"push\" and \"ready\". Push will push events onto the queue and will fire them as soon as \nthe queue is ready.\n```js\nmyQueue.ready(); // Call this when you're ready to rock\n```\n\nThere are two ways to call push. If you dont need to execute a callback, simply do\n```js\nmyQueue.push(function () {\n  async stuff sans callback\n});\n```\n\nIf the function has a callback instead run \n```js\nmyQueue.push(function (callback) {\n  async stuff with callback\n}, callback)\n```\n\nIf you push a function onto the queue whose callback pushes a function onto the queue you'll run into a deadlock. This happens because the outer function's callback won't be called until the queue unlocks and the queue remains locked until the inner function (AKA the outer function's callback) is called. This is confusing so hopefully an example will explain it.\n```js\nmyQueue.push(function (callback) {\n  myQueue.push(function () {\n    async stuff\n  })\n}, callback)\n\n```\n\nThe solution to the deadlock is setting the setImmeadiate flag to true when you push a function which pushes a function onto the queue.\n```js\nmyQueue.push(function (callback) {\n  myQueue.push(function () {\n    async stuff\n    callback();\n  })\n}, callback, true)\n```\n\nNotice that to resolve the deadlock we use\n```js\nmyQueue.push(function (callback) {}, callback, true)\n```\n\ninstead of \n\n```js\nmyQueue.push(function (callback) {}, callback)\n```","maintainers":[{"name":"nlintz","email":"nlintz@gmail.com"}],"time":{"modified":"2022-06-26T20:14:33.712Z","created":"2014-06-10T23:59:21.241Z","0.0.1":"2014-06-10T23:59:21.974Z","0.0.2":"2014-06-11T00:06:54.218Z","0.0.3":"2014-06-12T04:06:39.411Z","0.0.4":"2014-06-12T04:08:24.384Z","0.0.5":"2014-06-12T04:23:27.263Z","0.0.6":"2014-06-12T04:41:10.358Z","0.0.7":"2014-06-12T04:43:38.392Z"},"readmeFilename":"readme.md","repository":{"type":"git","url":"git@githubcom:technicalmachine/sink_q.git"},"author":{"name":"Nathan Lintz"},"license":"MIT"}