{"_id":"agenda-n","_rev":"32-0f565d83b409fa555a491ff0f5bb9eb2","name":"agenda-n","description":"Light weight job scheduler for Node.js","dist-tags":{"latest":"1.0.0"},"versions":{"0.0.1":{"name":"agenda-n","version":"0.0.1","description":"Light weight job scheduler for Node.js","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git://github.com/elmurci/agenda-n"},"keywords":["job","jobs","cron","delayed","scheduler","runner"],"author":{"name":"Javier Romero","email":"elmurci@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/rschmukler/agenda/issues"},"dependencies":{"human-interval":"~0.1.3","date.js":"~0.2.0","mongoskin":"~1.4.1","cron":"~1.0.1"},"devDependencies":{"mocha":"~1.13.0","expect.js":"~0.2.0","mocha-lcov-reporter":"0.0.1","coveralls":"~2.3.0","blanket":"~1.1.5","q":"~1.0.0"},"homepage":"https://github.com/elmurci/agenda-n","directories":{"test":"test"},"gitHead":"a765009bb857a6f56fd8084758cd8aebc430431b","_id":"agenda-n@0.0.1","_shasum":"d21d5bd8a67c95213ccf31dc59ca37c97ff2bac7","_from":"./","_npmVersion":"1.4.23","_npmUser":{"name":"elmurci","email":"elmurci@gmail.com"},"maintainers":[{"name":"elmurci","email":"elmurci@gmail.com"}],"dist":{"shasum":"d21d5bd8a67c95213ccf31dc59ca37c97ff2bac7","tarball":"https://registry.npmjs.org/agenda-n/-/agenda-n-0.0.1.tgz","integrity":"sha512-+KtkJMJilKVISDiKcuZJUWy+V3dQhbH7sIdmM+Yeel9cLq2QQcbacbkFnQF/yrvBbRgk7CYqPPtoP23XRW0S4A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFlAfp7sNY3MJvsLvHqx9xrIMlhVkAzjRq12uUl1ajpYAiAF+xonOFmKmrm+s3OF6ZxdXPyuSlReBpP9w1ToJZTCeA=="}]}},"0.0.3":{"name":"agenda-n","version":"0.0.3","description":"Light weight job scheduler for Node.js","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git://github.com/elmurci/agenda-n"},"keywords":["job","jobs","cron","delayed","scheduler","runner"],"author":{"name":"Javi Romero","email":"elmurci@gmail.com","url":"http://javiromero.com/"},"license":"MIT","bugs":{"url":"https://github.com/elmurci/agenda-n/issues"},"dependencies":{"human-interval":"~0.1.3","date.js":"~0.2.0","mongoskin":"~1.4.1","cron":"~1.0.1"},"devDependencies":{"mocha":"~1.13.0","expect.js":"~0.2.0","mocha-lcov-reporter":"0.0.1","coveralls":"~2.3.0","blanket":"~1.1.5","q":"~1.0.0"},"gitHead":"916111ef544901b3fa98b29749dc649369cb4957","homepage":"https://github.com/elmurci/agenda-n","_id":"agenda-n@0.0.3","_shasum":"06376a1f7d26a1e1798d0853bc1733e9ad5d1548","_from":".","_npmVersion":"2.1.14","_nodeVersion":"0.10.31","_npmUser":{"name":"elmurci","email":"elmurci@gmail.com"},"maintainers":[{"name":"elmurci","email":"elmurci@gmail.com"}],"dist":{"shasum":"06376a1f7d26a1e1798d0853bc1733e9ad5d1548","tarball":"https://registry.npmjs.org/agenda-n/-/agenda-n-0.0.3.tgz","integrity":"sha512-hirrtPQuv4aGlNQTcXCc8H9nF3tAOLJhtuyIHRC34YjZKtQfFmDwmBv8PSr13es19XDopS3XyJv21iK38qUTGw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHUO5KqXuqxiYQbUGLPt4JPMAL6Vznr6NcYUt/ErGUCSAiEAkQjdQ+rP7Q/ByT1Z5zsti0DYWG4vTnkT+1IQpmSRgaU="}]}},"0.0.4":{"name":"agenda-n","version":"0.0.4","description":"Light weight job scheduler for Node.js","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git://github.com/elmurci/agenda-n"},"keywords":["job","jobs","cron","delayed","scheduler","runner"],"author":{"name":"Javi Romero","email":"elmurci@gmail.com","url":"http://javiromero.com/"},"license":"MIT","bugs":{"url":"https://github.com/elmurci/agenda-n/issues"},"dependencies":{"human-interval":"~0.1.3","date.js":"~0.2.0","mongoskin":"~1.4.1","cron":"~1.0.1"},"devDependencies":{"mocha":"~1.13.0","expect.js":"~0.2.0","mocha-lcov-reporter":"0.0.1","coveralls":"~2.3.0","blanket":"~1.1.5","q":"~1.0.0"},"gitHead":"84516800dd81c3508fdb184a7fcadfdcfeb9d054","homepage":"https://github.com/elmurci/agenda-n","_id":"agenda-n@0.0.4","_shasum":"ad59c2741ec431b0bf28d274c115ca72bf34e274","_from":".","_npmVersion":"2.1.14","_nodeVersion":"0.10.31","_npmUser":{"name":"elmurci","email":"elmurci@gmail.com"},"maintainers":[{"name":"elmurci","email":"elmurci@gmail.com"}],"dist":{"shasum":"ad59c2741ec431b0bf28d274c115ca72bf34e274","tarball":"https://registry.npmjs.org/agenda-n/-/agenda-n-0.0.4.tgz","integrity":"sha512-cQPUZ2RQ+PIEUfuK7FGJT/k3dc6Mv+51SbbvHDvazF9EHgf+SRsRBb0PrXI0Sy6DKQjVlPfRhQzXYvlPsL7m1w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCYGj78UayEwZnheS4j728pOB9W5tsLoJPHDpZECpc3vAIhALc7IaX8WuzZjyIlsX5MTUctM0k1p+QiTCj91AtQN3k3"}]}},"0.0.5":{"name":"agenda-n","version":"0.0.5","description":"Light weight job scheduler for Node.js","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git://github.com/elmurci/agenda-n"},"keywords":["job","jobs","cron","delayed","scheduler","runner"],"author":{"name":"Javi Romero","email":"elmurci@gmail.com","url":"http://javiromero.com/"},"license":"MIT","bugs":{"url":"https://github.com/elmurci/agenda-n/issues"},"dependencies":{"human-interval":"~0.1.3","date.js":"~0.2.0","mongoskin":"~1.4.1","cron":"~1.0.1"},"devDependencies":{"mocha":"~1.13.0","expect.js":"~0.2.0","mocha-lcov-reporter":"0.0.1","coveralls":"~2.3.0","blanket":"~1.1.5","q":"~1.0.0"},"gitHead":"8404d76c073039dbbccbaf19b67596d3413c5814","homepage":"https://github.com/elmurci/agenda-n","_id":"agenda-n@0.0.5","_shasum":"74736c0ef3ebc055bd3827a4b8f5829ebc66b011","_from":".","_npmVersion":"2.1.14","_nodeVersion":"0.10.31","_npmUser":{"name":"elmurci","email":"elmurci@gmail.com"},"maintainers":[{"name":"elmurci","email":"elmurci@gmail.com"}],"dist":{"shasum":"74736c0ef3ebc055bd3827a4b8f5829ebc66b011","tarball":"https://registry.npmjs.org/agenda-n/-/agenda-n-0.0.5.tgz","integrity":"sha512-AMafMQqeepm+zOsYLyyVNEhiEIGcnMR2Ynd3LuL4YilK0I1foCRtRaKx8VbY6ycLskLXesdJ6lUbM2d7VmVmxg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCNdV6wrlFZUzV3yYk0cBeXza/YPBLvYZnC2Dzak3GcTgIgQUQf8U0whiYSCGzdfEaQXrmcsBTRDLR0OrrzevNWYNA="}]}},"0.0.6":{"name":"agenda-n","version":"0.0.6","description":"Light weight job scheduler for Node.js","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git://github.com/elmurci/agenda-n"},"keywords":["job","jobs","cron","delayed","scheduler","runner"],"author":{"name":"Javi Romero","email":"elmurci@gmail.com","url":"http://javiromero.com/"},"license":"MIT","bugs":{"url":"https://github.com/elmurci/agenda-n/issues"},"dependencies":{"human-interval":"~0.1.3","date.js":"~0.2.0","mongoskin":"~1.4.1","cron":"~1.0.1"},"devDependencies":{"mocha":"~1.13.0","expect.js":"~0.2.0","mocha-lcov-reporter":"0.0.1","coveralls":"~2.3.0","blanket":"~1.1.5","q":"~1.0.0"},"gitHead":"777cd27d4aa28232fb490a770d91306f34c7a305","homepage":"https://github.com/elmurci/agenda-n","_id":"agenda-n@0.0.6","_shasum":"84e551dffb0a131dcbe1dc00946ab1e98095de27","_from":".","_npmVersion":"2.1.14","_nodeVersion":"0.10.31","_npmUser":{"name":"elmurci","email":"elmurci@gmail.com"},"maintainers":[{"name":"elmurci","email":"elmurci@gmail.com"}],"dist":{"shasum":"84e551dffb0a131dcbe1dc00946ab1e98095de27","tarball":"https://registry.npmjs.org/agenda-n/-/agenda-n-0.0.6.tgz","integrity":"sha512-K8rSBtaUIIn0Q3YKMI119xl3OLqFymfIer0iIIomzQH2MvdaVRFlCJWZPS0yGzf+CV+omxFcbQelPMqb4/5MDA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC2Lir7O1lAAk66gvx8Xz1gvKhFzv5AGlxeIAeyr4W00QIgPqL/61ypAcNna5h9bniJFfgZqkGlH4/0+ItcfZkFH50="}]}},"0.0.7":{"name":"agenda-n","version":"0.0.7","description":"Light weight job scheduler for Node.js","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git://github.com/elmurci/agenda-n"},"keywords":["job","jobs","cron","delayed","scheduler","runner"],"author":{"name":"Javi Romero","email":"elmurci@gmail.com","url":"http://javiromero.com/"},"license":"MIT","bugs":{"url":"https://github.com/elmurci/agenda-n/issues"},"dependencies":{"human-interval":"~0.1.3","date.js":"~0.2.0","mongoskin":"~1.4.1","cron":"~1.0.1"},"devDependencies":{"mocha":"~1.13.0","expect.js":"~0.2.0","mocha-lcov-reporter":"0.0.1","coveralls":"~2.3.0","blanket":"~1.1.5","q":"~1.0.0"},"gitHead":"7c9b59f24e7fd1221361ee38cc52d4b72718f058","homepage":"https://github.com/elmurci/agenda-n","_id":"agenda-n@0.0.7","_shasum":"944eb9abdff296d725ad29249b2f7f6fbc548cae","_from":".","_npmVersion":"2.1.14","_nodeVersion":"0.10.31","_npmUser":{"name":"elmurci","email":"elmurci@gmail.com"},"maintainers":[{"name":"elmurci","email":"elmurci@gmail.com"}],"dist":{"shasum":"944eb9abdff296d725ad29249b2f7f6fbc548cae","tarball":"https://registry.npmjs.org/agenda-n/-/agenda-n-0.0.7.tgz","integrity":"sha512-EBqwq+rx3Bc6lSVHAHc+p+cyGgt9kduJK22bdxrIrIkXHPjtIfza18RnEW36HpJK99HwOFwbn4CGhwPpzVPgtA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDCBH5XLUjhnWKNRW+DyNB+yfh+ycPiLcyTGjMLUoScIAIhAIowiiR9aR1u7++A8gmey6bBXjgmGs+zebQcVs5NJPvV"}]}},"0.0.8":{"name":"agenda-n","version":"0.0.8","description":"Light weight job scheduler for Node.js","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git://github.com/elmurci/agenda-n"},"keywords":["job","jobs","cron","delayed","scheduler","runner"],"author":{"name":"Javi Romero","email":"elmurci@gmail.com","url":"http://javiromero.com/"},"license":"MIT","bugs":{"url":"https://github.com/elmurci/agenda-n/issues"},"dependencies":{"human-interval":"~0.1.3","date.js":"~0.2.0","mongoskin":"~1.4.1","cron":"~1.0.1"},"devDependencies":{"mocha":"~1.13.0","expect.js":"~0.2.0","mocha-lcov-reporter":"0.0.1","coveralls":"~2.3.0","blanket":"~1.1.5","q":"~1.0.0"},"gitHead":"86b91f3029fe2d5f8ff0546cc8605c40a276f8c1","homepage":"https://github.com/elmurci/agenda-n","_id":"agenda-n@0.0.8","_shasum":"ac8e148a60a1f82b1f9f3d866a61b0c4ce0b6ae5","_from":".","_npmVersion":"2.1.14","_nodeVersion":"0.10.31","_npmUser":{"name":"elmurci","email":"elmurci@gmail.com"},"maintainers":[{"name":"elmurci","email":"elmurci@gmail.com"}],"dist":{"shasum":"ac8e148a60a1f82b1f9f3d866a61b0c4ce0b6ae5","tarball":"https://registry.npmjs.org/agenda-n/-/agenda-n-0.0.8.tgz","integrity":"sha512-DwbkIuhxb6MzKtJ4/EWX6yNvvfcAcWeclsLMYKZy+meY9IlKcBHUdZD4Y4LqoPFscrH3m1txNq9v9Q26RaTl7g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGvEf9RATGwj8aROW9/dAW3zx5US4LtoVbruzxvRUCoVAiBcjCk0GpjdUT2HLKo1BtjqVb9u9wPtB1qizC7zOL1Ujg=="}]}},"0.0.9":{"name":"agenda-n","version":"0.0.9","description":"Light weight job scheduler for Node.js","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git://github.com/elmurci/agenda-n"},"keywords":["job","jobs","cron","delayed","scheduler","runner"],"author":{"name":"Javi Romero","email":"elmurci@gmail.com","url":"http://javiromero.com/"},"license":"MIT","bugs":{"url":"https://github.com/elmurci/agenda-n/issues"},"dependencies":{"human-interval":"~0.1.3","date.js":"~0.2.0","mongoskin":"~1.4.1","cron":"~1.0.1"},"devDependencies":{"mocha":"~1.13.0","expect.js":"~0.2.0","mocha-lcov-reporter":"0.0.1","coveralls":"~2.3.0","blanket":"~1.1.5","q":"~1.0.0"},"gitHead":"255e94ed0fd79445070283359dfd16fb6377576f","homepage":"https://github.com/elmurci/agenda-n","_id":"agenda-n@0.0.9","_shasum":"5f4f0115954d618c4ad5ec27992a10a9936e0677","_from":".","_npmVersion":"2.1.14","_nodeVersion":"0.10.31","_npmUser":{"name":"elmurci","email":"elmurci@gmail.com"},"maintainers":[{"name":"elmurci","email":"elmurci@gmail.com"}],"dist":{"shasum":"5f4f0115954d618c4ad5ec27992a10a9936e0677","tarball":"https://registry.npmjs.org/agenda-n/-/agenda-n-0.0.9.tgz","integrity":"sha512-9yG4F9P77sDN/3Di1rr+l3QCMU/N9c33GGhsnsSzcXGGYQV478pkGcsTXBg0AAUUOiIAqgCRhIIUXGUXatjXrA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCM790x4bKZvlbAekcHpwsPTTOg1XiIyGbSXPex1f6BUQIhAMHtscFkrz0KPnqBbUjR0eoPGSOZC2b0d+mndjCHI341"}]}},"0.0.10":{"name":"agenda-n","version":"0.0.10","description":"Light weight job scheduler for Node.js","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git://github.com/elmurci/agenda-n"},"keywords":["job","jobs","cron","delayed","scheduler","runner"],"author":{"name":"Javi Romero","email":"elmurci@gmail.com","url":"http://javiromero.com/"},"license":"MIT","bugs":{"url":"https://github.com/elmurci/agenda-n/issues"},"dependencies":{"human-interval":"~0.1.3","date.js":"~0.2.0","mongoskin":"~1.4.1","cron":"~1.0.1"},"devDependencies":{"mocha":"~1.13.0","expect.js":"~0.2.0","mocha-lcov-reporter":"0.0.1","coveralls":"~2.3.0","blanket":"~1.1.5","q":"~1.0.0"},"gitHead":"a8db34345fe0b79f55c0bfd77c2f66cf0be9c785","homepage":"https://github.com/elmurci/agenda-n","_id":"agenda-n@0.0.10","_shasum":"e76000598fa469e4b0f393d18c7c05be033a368f","_from":".","_npmVersion":"2.1.14","_nodeVersion":"0.10.31","_npmUser":{"name":"elmurci","email":"elmurci@gmail.com"},"maintainers":[{"name":"elmurci","email":"elmurci@gmail.com"}],"dist":{"shasum":"e76000598fa469e4b0f393d18c7c05be033a368f","tarball":"https://registry.npmjs.org/agenda-n/-/agenda-n-0.0.10.tgz","integrity":"sha512-sSQiMQL+MPKCDPTKVBn/aLJo8EC0j4R8rZGRVJMgQgA3f61qA8SZF2glWHUP2JAqvkTDSESQxMMtvYybvXigoQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHgzLocHEwm/avjC8UPmphH0N9U4yxxPkWSaVZDdZQHdAiEAm0Rk+9kdXBmm6gyJGrJQDj0LAxmnb5GD8QIyf6dgTzE="}]}},"0.0.11":{"name":"agenda-n","version":"0.0.11","description":"Light weight job scheduler for Node.js","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git://github.com/elmurci/agenda-n"},"keywords":["job","jobs","cron","delayed","scheduler","runner"],"author":{"name":"Javi Romero","email":"elmurci@gmail.com","url":"http://javiromero.com/"},"license":"MIT","bugs":{"url":"https://github.com/elmurci/agenda-n/issues"},"dependencies":{"human-interval":"~0.1.3","date.js":"~0.2.0","mongoskin":"~1.4.1","cron":"~1.0.1"},"devDependencies":{"mocha":"~1.13.0","expect.js":"~0.2.0","mocha-lcov-reporter":"0.0.1","coveralls":"~2.3.0","blanket":"~1.1.5","q":"~1.0.0"},"gitHead":"e42740b02fa730f00c26d9dd90e39c8021f682f4","homepage":"https://github.com/elmurci/agenda-n","_id":"agenda-n@0.0.11","_shasum":"b99b245752895dc1fec9d2e651f200fc09f6f558","_from":".","_npmVersion":"2.1.14","_nodeVersion":"0.10.31","_npmUser":{"name":"elmurci","email":"elmurci@gmail.com"},"maintainers":[{"name":"elmurci","email":"elmurci@gmail.com"}],"dist":{"shasum":"b99b245752895dc1fec9d2e651f200fc09f6f558","tarball":"https://registry.npmjs.org/agenda-n/-/agenda-n-0.0.11.tgz","integrity":"sha512-cd3p5E+RDr6Z8769N9bYW3E+fz4RALDNymU4pq0KbTZ0Auic92bDt16JZ+ErT34kd86RFJnVpdlnoPWtrBSz6w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBe6YysG/vc1CFLn46yxbgaX5Hmmxy4tCYFh7TXgN3DMAiB6M01G+3/cU6pJEvehSYbKaf4dllnv/ue53TwIDvcP+Q=="}]}},"0.0.12":{"name":"agenda-n","version":"0.0.12","description":"Light weight job scheduler for Node.js, based on agenda","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git://github.com/elmurci/agenda-n"},"keywords":["job","jobs","cron","delayed","scheduler","runner"],"author":{"name":"Javi Romero","email":"elmurci@gmail.com","url":"http://javiromero.com/"},"license":"MIT","bugs":{"url":"https://github.com/elmurci/agenda-n/issues"},"dependencies":{"human-interval":"~0.1.3","date.js":"~0.2.0","mongoskin":"~1.4.1","cron":"~1.0.1"},"devDependencies":{"mocha":"~1.13.0","expect.js":"~0.2.0","mocha-lcov-reporter":"0.0.1","coveralls":"~2.3.0","blanket":"~1.1.5","q":"~1.0.0"},"gitHead":"6642454a89afd0560c4945115f1bbc60bc95e6d3","homepage":"https://github.com/elmurci/agenda-n","_id":"agenda-n@0.0.12","_shasum":"9eaf66800dbcab7a1802709596b273225c27695b","_from":".","_npmVersion":"2.1.14","_nodeVersion":"0.10.31","_npmUser":{"name":"elmurci","email":"elmurci@gmail.com"},"maintainers":[{"name":"elmurci","email":"elmurci@gmail.com"}],"dist":{"shasum":"9eaf66800dbcab7a1802709596b273225c27695b","tarball":"https://registry.npmjs.org/agenda-n/-/agenda-n-0.0.12.tgz","integrity":"sha512-woEn6wU70VC07Y5lVY5Sz8Nkd09OeuW2pmm0vV2cNFCwuutzVu2kbxC4TJ5vKBDOKjx4nhzFm5dgdyHUuScYtA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE/7rQ2nEKa9Kz+zCev9pcWBOFIyzg/NJc96VbrPt4QZAiBhziEbk2rwCqnDJbTyaqSv7aeeiDlbDIp8DK+VjLzRwQ=="}]}},"0.0.13":{"name":"agenda-n","version":"0.0.13","description":"Light weight job scheduler for Node.js, based on agenda","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git://github.com/elmurci/agenda-n"},"keywords":["job","jobs","cron","delayed","scheduler","runner"],"author":{"name":"Javi Romero","email":"elmurci@gmail.com","url":"http://javiromero.com/"},"license":"MIT","bugs":{"url":"https://github.com/elmurci/agenda-n/issues"},"dependencies":{"human-interval":"~0.1.3","date.js":"~0.2.0","mongoskin":"~1.4.1","cron":"~1.0.1"},"devDependencies":{"mocha":"~1.13.0","expect.js":"~0.2.0","mocha-lcov-reporter":"0.0.1","coveralls":"~2.3.0","blanket":"~1.1.5","q":"~1.0.0"},"gitHead":"0fe1ae7275e79026aa4a92cc04391d794d032b83","homepage":"https://github.com/elmurci/agenda-n","_id":"agenda-n@0.0.13","_shasum":"0283bf26484a3a47b540b1262ca73110d5ecd643","_from":".","_npmVersion":"2.1.14","_nodeVersion":"0.10.31","_npmUser":{"name":"elmurci","email":"elmurci@gmail.com"},"maintainers":[{"name":"elmurci","email":"elmurci@gmail.com"}],"dist":{"shasum":"0283bf26484a3a47b540b1262ca73110d5ecd643","tarball":"https://registry.npmjs.org/agenda-n/-/agenda-n-0.0.13.tgz","integrity":"sha512-kWgc6Akr9vqVjl9fThls0FuTyKL4mtlMzZeaqZJv4JautyJfFuQz5HHeP4XIVc+vtQpOEi1w1rM94aC1N3e0VA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE1V5qcH216W4RFzhSbTwKLtK/BaUMkF5Vb2gvXtjNY4AiBzwBD81kWh/dgGzSFNrVGaQThGS9V47KOootu8/z2+MQ=="}]}},"1.0.0":{"name":"agenda-n","version":"1.0.0","description":"Light weight job scheduler for Node.js","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git://github.com/elmurci/agenda-n.git"},"keywords":["job","jobs","cron","delayed","scheduler","runner"],"author":{"name":"Javier Romero","email":"elmurci@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/elmurci/agenda-n/issues"},"dependencies":{"cron":"~1.0.1","date.js":"~0.2.0","human-interval":"~0.1.3","moment-timezone":"^0.5.0","mongodb":"2.1.21"},"devDependencies":{"blanket":"1.1.5","coveralls":"~2.11.4","expect.js":"~0.3.1","mocha":"~2.3.2","mocha-lcov-reporter":"0.0.2","q":"~1.4.1"},"gitHead":"d3c3b77b4cf8116a6b5a9ae55fb0452b942b2bfb","homepage":"https://github.com/elmurci/agenda-n#readme","_id":"agenda-n@1.0.0","_shasum":"5ff64c98d3321350b9dc6e82897385e8dea62eda","_from":".","_npmVersion":"2.15.8","_nodeVersion":"4.4.7","_npmUser":{"name":"elmurci","email":"elmurci@gmail.com"},"dist":{"shasum":"5ff64c98d3321350b9dc6e82897385e8dea62eda","tarball":"https://registry.npmjs.org/agenda-n/-/agenda-n-1.0.0.tgz","integrity":"sha512-fhX5grHoZ7Z8i1MbNoji4xjY7Yk4gPvn4PyzLNwnun6SkL5tQCx2PXLOjNToyc73wHZ0AhJ+rQQ4fWWmfutb2A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFQlHFjlAZMZxcQ4wEzout1rCEXgOz5CESAp733zuhJdAiAMFu/ZD9D4ZMFjYDJEmL4WKwCYZ9am90e1hiELg8y9Mw=="}]},"maintainers":[{"name":"elmurci","email":"elmurci@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/agenda-n-1.0.0.tgz_1473418551590_0.378507541725412"}}},"readme":"# Agenda\n[![Build Status](https://api.travis-ci.org/rschmukler/agenda.svg)](http://travis-ci.org/rschmukler/agenda)\n[![Dependency Status](https://david-dm.org/rschmukler/agenda.svg)](https://david-dm.org/rschmukler/agenda)\n[![devDependency Status](https://david-dm.org/rschmukler/agenda/dev-status.svg)](https://david-dm.org/rschmukler/agenda#info=devDependencies)\n[![Code Climate](https://d3s6mut3hikguw.cloudfront.net/github/rschmukler/agenda.svg)](https://codeclimate.com/github/rschmukler/agenda/badges)\n[![Coverage Status](https://coveralls.io/repos/rschmukler/agenda/badge.svg)](https://coveralls.io/r/rschmukler/agenda)\n\nAgenda is a light-weight job scheduling library for Node.js.\n\nIt offers:\n\n- Minimal overhead. Agenda aims to keep its code base small.\n- Mongo backed persistance layer.\n- Scheduling with configurable priority, concurrency, and repeating\n- Scheduling via cron or human readable syntax.\n- Event backed job queue that you can hook into.\n- Optional standalone web-interfaces (see [agendash](https://github.com/joeframbach/agendash) and [agenda-ui](https://github.com/moudy/agenda-ui))\n\n\n# Installation\n\nInstall via NPM\n\n    npm install agenda\n\nYou will also need a working [mongo](http://www.mongodb.org/) database (2.6+) to point it to.\n\n# Example Usage\n\n```js\n\nvar mongoConnectionString = \"mongodb://127.0.0.1/agenda\";\n\nvar agenda = new Agenda({db: {address: mongoConnectionString}});\n\n// or override the default collection name:\n// var agenda = new Agenda({db: {address: mongoConnectionString, collection: \"jobCollectionName\"}});\n\n// or pass additional connection options:\n// var agenda = new Agenda({db: {address: mongoConnectionString, collection: \"jobCollectionName\", options: {server:{auto_reconnect:true}}});\n\n// or pass in an existing mongodb-native MongoClient instance\n// var agenda = new Agenda({mongo: myMongoClient});\n\nagenda.define('delete old users', function(job, done) {\n  User.remove({lastLogIn: { $lt: twoDaysAgo }}, done);\n});\n\nagenda.on('ready', function() {\n  agenda.every('3 minutes', 'delete old users');\n\n  // Alternatively, you could also do:\n  agenda.every('*/3 * * * *', 'delete old users');\n\n  agenda.start();\n});\n\n```\n\n```js\nagenda.define('send email report', {priority: 'high', concurrency: 10}, function(job, done) {\n  var data = job.attrs.data;\n  emailClient.send({\n    to: data.to,\n    from: 'example@example.com',\n    subject: 'Email Report',\n    body: '...'\n  }, done);\n});\n\nagenda.on('ready', function() {\n  agenda.schedule('in 20 minutes', 'send email report', {to: 'admin@example.com'});\n  agenda.start();\n});\n```\n\n```js\nagenda.on('ready', function() {\n  var weeklyReport = agenda.create('send email report', {to: 'another-guy@example.com'})\n  weeklyReport.repeatEvery('1 week').save();\n  agenda.start();\n});\n```\n\n# Full documentation\n\nAgenda's basic control structure is an instance of an agenda. Agenda's are\nmapped to a database collection and load the jobs from within.\n\n## Table of Contents\n- [Configuring an agenda](#configuring-an-agenda)\n- [Agenda Events](#agenda-events)\n- [Defining job processors](#defining-job-processors)\n- [Creating jobs](#creating-jobs)\n- [Managing jobs](#managing-jobs)\n- [Starting the job processor](#starting-the-job-processor)\n- [Multiple job processors](#multiple-job-processors)\n- [Manually working with jobs](#manually-working-with-a-job)\n- [Job Queue Events](#job-queue-events)\n- [Frequently asked questions](#frequently-asked-questions)\n- [Example Project structure](#example-project-structure)\n- [Acknowledgements](#acknowledgements)\n\n## Configuring an agenda\nAll configuration methods are chainable, meaning you can do something like:\n\n```js\nvar agenda = new Agenda();\nagenda\n  .database(...)\n  .processEvery('3 minutes')\n  ...;\n```\n\nAgenda uses [Human Interval](http://github.com/rschmukler/human-interval) for specifying the intervals. It supports the following units:\n\n`seconds`, `minutes`, `hours`, `days`,`weeks`, `months` -- assumes 30 days, `years` -- assumes 365 days\n\nMore sophisticated examples\n\n\n```js\nagenda.processEvery('one minute');\nagenda.processEvery('1.5 minutes');\nagenda.processEvery('3 days and 4 hours');\nagenda.processEvery('3 days, 4 hours and 36 seconds');\n```\n\n### database(url, [collectionName])\n\nSpecifies the database at the `url` specified. If no collection name is given,\n`agendaJobs` is used.\n\n```js\nagenda.database('localhost:27017/agenda-test', 'agendaJobs');\n```\n\nYou can also specify it during instantiation.\n\n```js\nvar agenda = new Agenda({db: { address: 'localhost:27017/agenda-test', collection: 'agendaJobs' }});\n```\n\nAgenda will emit a `ready` event (see [Agenda Events](#agenda-events)) when properly connected to the database and it is safe to start using Agenda.\n\n### mongo(mongoClientInstance)\n\nUse an existing mongodb-native MongoClient instance. This can help consolidate connections to a\ndatabase. You can instead use `.database` to have agenda handle connecting for\nyou.\n\n\n\nPlease note that this must be a *collection*. Also, you will want to run the following\nafterwards to ensure the database has the proper indexes:\n\n```js\nfunction ignoreErrors() {}\n\nagenda._db.ensureIndex(\"nextRunAt\", ignoreErrors)\n.ensureIndex(\"lockedAt\", ignoreErrors)\n.ensureIndex(\"name\", ignoreErrors)\n.ensureIndex(\"priority\", ignoreErrors);\n\nfunction ignoreErrors\n```\n\nYou can also specify it during instantiation.\n\n```js\nvar agenda = new Agenda({mongo: mongoClientInstance});\n```\n\n### name(name)\n\nTakes a string `name` and sets `lastModifiedBy` to it in the job database.\nUseful for if you have multiple job processors (agendas) and want to see which\njob queue last ran the job.\n\n```js\nagenda.name(os.hostname + '-' + process.pid);\n```\n\nYou can also specify it during instantiation\n\n```js\nvar agenda = new Agenda({name: 'test queue'});\n```\n\n### processEvery(interval)\n\nTakes a string `interval` which can be either a traditional javascript number,\nor a string such as `3 minutes`\n\nSpecifies the frequency at which agenda will query the database looking for jobs\nthat need to be processed. Agenda internally uses `setTimeout` to guarantee that\njobs run at (close to ~3ms) the right time.\n\nDecreasing the frequency will result in fewer database queries, but more jobs\nbeing stored in memory.\n\nAlso worth noting is that if the job is queue is shutdown, any jobs stored in memory\nthat haven't run will still be locked, meaning that you may have to wait for the\nlock to expire.\n\n```js\nagenda.processEvery('1 minute');\n```\n\nYou can also specify it during instantiation\n\n```js\nvar agenda = new Agenda({processEvery: '30 seconds'});\n```\n\n### maxConcurrency(number)\n\nTakes a `number` which specifies the max number of jobs that can be running at\nany given moment. By default it is `20`.\n\n```js\nagenda.maxConcurrency(20);\n```\n\nYou can also specify it during instantiation\n\n```js\nvar agenda = new Agenda({maxConcurrency: 20});\n```\n\n### defaultConcurrency(number)\n\nTakes a `number` which specifies the default number of a specific job that can be running at\nany given moment. By default it is `5`.\n\n```js\nagenda.defaultConcurrency(5);\n```\n\nYou can also specify it during instantiation\n\n```js\nvar agenda = new Agenda({defaultConcurrency: 5});\n```\n\n### lockLimit(number)\n\nTakes a `number` shich specifies the max number jobs that can be locked at any given moment. By default it is `0` for no max.\n\n```js\nagenda.lockLimit(0);\n```\n\nYou can also specify it during instantiation\n\n```js\nvar agenda = new Agenda({lockLimit: 0});\n```\n\n### defaultLockLimit(number)\n\nTakes a `number` which specifies the default number of a specific job that can be locked at any given moment. By default it is `0` for no max.\n\n```js\nagenda.defaultLockLimit(0);\n```\n\nYou can also specify it during instantiation\n\n```js\nvar agenda = new Agenda({defaultLockLimit: 0});\n```\n\n### defaultLockLifetime(number)\n\nTakes a `number` which specifies the default lock lifetime in milliseconds. By\ndefault it is 10 minutes. This can be overridden by specifying the\n`lockLifetime` option to a defined job.\n\nA job will unlock if it is finished (ie. `done` is called) before the `lockLifetime`.\nThe lock is useful if the job crashes or times out.\n\n```js\nagenda.defaultLockLifetime(10000);\n```\n\nYou can also specify it during instantiation\n\n```js\nvar agenda = new Agenda({defaultLockLifetime: 10000});\n```\n\n## Agenda Events\n\nAn instance of an agenda will emit the following events:\n\n- `ready` - called when Agenda mongo connection is successfully opened\n- `error` - called when Agenda mongo connection process has thrown an error\n\n```js\nagenda.on('ready', function() {\n  agenda.start();\n});\n```\n\n## Defining Job Processors\n\nBefore you can use a job, you must define its processing behavior.\n\n### define(jobName, [options], fn)\n\nDefines a job with the name of `jobName`. When a job of job name gets run, it\nwill be passed to `fn(job, done)`. To maintain asynchronous behavior, you must\ncall `done()` when you are processing the job. If your function is synchronous,\nyou may omit `done` from the signature.\n\n`options` is an optional argument which can overwrite the defaults. It can take\nthe following:\n\n- `concurrency`: `number` maximum number of that job that can be running at once (per instance of agenda)\n- `lockLimit`: `number` maximum number of that job that can be locked at once (per instance of agenda)\n- `lockLifetime`: `number` interval in ms of how long the job stays locked for (see [multiple job processors](#multiple-job-processors) for more info).\nA job will automatically unlock if `done()` is called.\n- `priority`: `(lowest|low|normal|high|highest|number)` specifies the priority\n  of the job. Higher priority jobs will run first. See the priority mapping\n  below\n\nPriority mapping:\n```\n{\n  highest: 20,\n  high: 10,\n  default: 0,\n  low: -10,\n  lowest: -20\n}\n```\n\nAsync Job:\n```js\nagenda.define('some long running job', function(job, done) {\n  doSomelengthyTask(function(data) {\n    formatThatData(data);\n    sendThatData(data);\n    done();\n  });\n});\n```\n\nSync Job:\n\n```js\nagenda.define('say hello', function(job) {\n  console.log(\"Hello!\");\n});\n```\n\n## Creating Jobs\n\n### every(interval, name, [data], [options], [cb])\n\nRuns job `name` at the given `interval`. Optionally, data and options can be passed in.\nEvery creates a job of type `single`, which means that it will only create one\njob in the database, even if that line is run multiple times. This lets you put\nit in a file that may get run multiple times, such as `webserver.js` which may\nreboot from time to time.\n\n`interval` can be a human-readable format `String`, a cron format `String`, or a `Number`.\n\n`data` is an optional argument that will be passed to the processing function\nunder `job.attrs.data`.\n\n`options` is an optional argument that will be passed to `job.repeatEvery`. In order to use\nthis argument, `data` must also be specified.\n\n`cb` is an optional callback function which will be called when the job has been\npersisted in the database.\n\n\nReturns the `job`.\n\n```js\nagenda.define('printAnalyticsReport', function(job, done) {\n  User.doSomethingReallyIntensive(function(err, users) {\n    processUserData();\n    console.log(\"I print a report!\");\n    done();\n  });\n});\n\nagenda.every('15 minutes', 'printAnalyticsReport');\n```\n\nOptionally, `name` could be array of job names, which is convenient for scheduling\ndifferent jobs for same `interval`.\n\n```js\nagenda.every('15 minutes', ['printAnalyticsReport', 'sendNotifications', 'updateUserRecords']);\n```\n\nIn this case, `every` returns array of `jobs`.\n\n### schedule(when, name, [data], cb)\n\nSchedules a job to run `name` once at a given time. `when` can be a `Date` or a\n`String` such as `tomorrow at 5pm`.\n\n`data` is an optional argument that will be passed to the processing function\nunder `job.attrs.data`.\n\n`cb` is an optional callback function which will be called when the job has been\npersisted in the database.\n\nReturns the `job`.\n\n```js\nagenda.schedule('tomorrow at noon', 'printAnalyticsReport', {userCount: 100});\n```\n\nOptionally, `name` could be array of job names, similar to `every` method.\n\n```js\nagenda.schedule('tomorrow at noon', ['printAnalyticsReport', 'sendNotifications', 'updateUserRecords']);\n```\n\nIn this case, `schedule` returns array of `jobs`.\n\n### now(name, [data], [cb])\n\nSchedules a job to run `name` once immediately.\n\n`data` is an optional argument that will be passed to the processing function\nunder `job.attrs.data`.\n\n`cb` is an optional callback function which will be called when the job has been\npersisted in the database.\n\nReturns the `job`.\n\n```js\nagenda.now('do the hokey pokey');\n```\n\n### create(jobName, data)\n\nReturns an instance of a `jobName` with `data`. This does *NOT* save the job in\nthe database. See below to learn how to manually work with jobs.\n\n```js\nvar job = agenda.create('printAnalyticsReport', {userCount: 100});\njob.save(function(err) {\n  console.log(\"Job successfully saved\");\n});\n```\n\n## Managing Jobs\n\n\n### jobs(mongodb-native query)\n\nLets you query all of the jobs in the agenda job's database. This is a full [mongodb-native](https://github.com/mongodb/node-mongodb-native)\n`find` query. See mongodb-native's documentation for details.\n\n```js\nagenda.jobs({name: 'printAnalyticsReport'}, function(err, jobs) {\n  // Work with jobs (see below)\n});\n```\n\n### cancel(mongodb-native query, cb)\n\nCancels any jobs matching the passed mongodb-native query, and removes them from the database.\n\n```js\nagenda.cancel({name: 'printAnalyticsReport'}, function(err, numRemoved) {\n});\n```\n\nThis functionality can also be achieved by first retrieving all the jobs from the database using `agenda.jobs()`, looping through the resulting array and calling `job.remove()` on each. It is however preferable to use `agenda.cancel()` for this use case, as this ensures the operation is atomic.\n\n### purge(cb)\n\nRemoves all jobs in the database without defined behaviors. Useful if you change a definition name and want to remove old jobs.\n\n*IMPORTANT:* Do not run this before you finish defining all of your jobs. If you do, you will nuke your database of jobs.\n\n```js\nagenda.purge(function(err, numRemoved) {\n});\n```\n\n## Starting the job processor\n\nTo get agenda to start processing jobs from the database you must start it. This\nwill schedule an interval (based on `processEvery`) to check for new jobs and\nrun them. You can also stop the queue.\n\n### start\n\nStarts the job queue processing, checking `processEvery` time to see if there\nare new jobs.\n\n### stop\n\nStops the job queue processing. Unlocks currently running jobs.\n\nThis can be very useful for graceful shutdowns so that currently running/grabbed jobs are abandoned so that other\njob queues can grab them / they are unlocked should the job queue start again. Here is an example of how to do a graceful\nshutdown.\n\n```js\nfunction graceful() {\n  agenda.stop(function() {\n    process.exit(0);\n  });\n}\n\nprocess.on('SIGTERM', graceful);\nprocess.on('SIGINT' , graceful);\n```\n\n\n## Multiple job processors\n\nSometimes you may want to have multiple node instances / machines process from\nthe same queue. Agenda supports a locking mechanism to ensure that multiple\nqueues don't process the same job.\n\nYou can configure the locking mechanism by specifying `lockLifetime` as an\ninterval when defining the job.\n\n```js\nagenda.define('someJob', {lockLifetime: 10000}, function(job, cb) {\n  //Do something in 10 seconds or less...\n});\n```\n\nThis will ensure that no other job processor (this one included) attempts to run the job again\nfor the next 10 seconds. If you have a particularly long running job, you will want to\nspecify a longer lockLifetime.\n\nBy default it is 10 minutes. Typically you shouldn't have a job that runs for 10 minutes,\nso this is really insurance should the job queue crash before the job is unlocked.\n\nWhen a job is finished (ie. `done` is called), it will automatically unlock.\n\n## Manually working with a job\n\nA job instance has many instance methods. All mutating methods must be followed\nwith a call to `job.save()` in order to persist the changes to the database.\n\n\n### repeatEvery(interval, [options])\n\nSpecifies an `interval` on which the job should repeat.\n\n`interval` can be a human-readable format `String`, a cron format `String`, or a `Number`.\n\n`options` is an optional argument that can include a `timezone` field. The timezone should\nbe a string as accepted by [moment-timezone](http://momentjs.com/timezone/) and is considered\nwhen using an interval in the cron string format.\n\n```js\njob.repeatEvery('10 minutes');\njob.save();\n```\n\n```js\njob.repeatEvery('0 6 * * *', {\n  timezone: 'America/New_York'\n});\njob.save();\n```\n\n### repeatAt(time)\n\nSpecifies a `time` when the job should repeat. [Possible values](https://github.com/matthewmueller/date#examples)\n\n```js\njob.repeatAt('3:30pm');\njob.save();\n```\n\n### schedule(time)\n\nSpecifies the next `time` at which the job should run.\n\n```js\njob.schedule('tomorrow at 6pm');\njob.save();\n```\n\n### priority(priority)\n\nSpecifies the `priority` weighting of the job. Can be a number or a string from\nthe above priority table.\n\n```js\njob.priority('low');\njob.save();\n```\n\n### unique(properties, [options])\n\nEnsure that only one instance of this job exists with the specified properties\n\n`options` is an optional argument which can overwrite the defaults. It can take\nthe following:\n\n- `insertOnly`: `boolean` will prevent any properties from persisting if job already exists. Defaults to false.\n\n```js\njob.unique({'data.type': 'active', 'data.userId': '123', nextRunAt(date)});\njob.save();\n```\n\n### fail(reason)\n\nSets `job.attrs.failedAt` to `now`, and sets `job.attrs.failReason`\nto `reason`.\n\nOptionally, `reason` can be an error, in which case `job.attrs.failReason` will\nbe set to `error.message`\n\n```js\njob.fail('insuficient disk space');\n// or\njob.fail(new Error('insufficient disk space'));\njob.save();\n```\n\n### run(callback)\n\nRuns the given `job` and calls `callback(err, job)` upon completion. Normally\nyou never need to call this manually.\n\n```js\njob.run(function(err, job) {\n  console.log(\"I don't know why you would need to do this...\");\n});\n```\n\n### save(callback)\n\nSaves the `job.attrs` into the database.\n\n```js\njob.save(function(err) {\n    if(!err) console.log(\"Successfully saved job to collection\");\n})\n```\n\n### remove(callback)\n\nRemoves the `job` from the database.\n\n```js\njob.remove(function(err) {\n    if(!err) console.log(\"Successfully removed job from collection\");\n})\n```\n\n### touch(callback)\n\nResets the lock on the job. Useful to indicate that the job hasn't timed out\nwhen you have very long running jobs.\n\n```js\nagenda.define('super long job', function(job, done) {\n  doSomeLongTask(function() {\n    job.touch(function() {\n      doAnotherLongTask(function() {\n        job.touch(function() {\n          finishOurLongTasks(done);\n        });\n      });\n    });\n  });\n});\n```\n\n## Job Queue Events\n\nAn instance of an agenda will emit the following events:\n\n- `start` - called just before a job starts\n- `start:job name` - called just before the specified job starts\n\n```js\nagenda.on('start', function(job) {\n  console.log(\"Job %s starting\", job.attrs.name);\n});\n```\n\n- `complete` - called when a job finishes, regardless of if it succeeds or fails\n- `complete:job name` - called when a job finishes, regardless of if it succeeds or fails\n\n```js\nagenda.on('complete', function(job) {\n  console.log(\"Job %s finished\", job.attrs.name);\n});\n```\n\n- `success` - called when a job finishes successfully\n- `success:job name` - called when a job finishes successfully\n\n```js\nagenda.on('success:send email', function(job) {\n  console.log(\"Sent Email Successfully to: %s\", job.attrs.data.to);\n});\n```\n\n- `fail` - called when a job throws an error\n- `fail:job name` - called when a job throws an error\n\n```js\nagenda.on('fail:send email', function(err, job) {\n  console.log(\"Job failed with error: %s\", err.message);\n});\n```\n\n## Frequently Asked Questions\n\n### Sample Project Structure?\n\nAgenda doesn't have a preferred project structure and leaves it to the user to\nchoose how they would like to use it. That being said, you can check out the\n[example project structure](#example-project-structure) below.\n\n\n### Can I Donate?\n\nThanks! I'm flattered, but it's really not necessary. If you really want to, you can find my [gittip here](https://www.gittip.com/rschmukler/).\n\n### Web Interface?\n\nAgenda itself does not have a web interface built in. That being said, there are two stand-alone web interfaces:\n\n- [agendash](https://github.com/joeframbach/agendash)\n  ![agendash interface](https://raw.githubusercontent.com/joeframbach/agendash/master/job-details.png)\n- [agenda-ui](https://github.com/moudy/agenda-ui)\n  ![agenda-ui interface](https://raw.githubusercontent.com/moudy/agenda-ui/screenshot/agenda-ui-screenshot.png)\n\n### Mongo vs Redis\n\nThe decision to use Mongo instead of Redis is intentional. Redis is often used for\nnon-essential data (such as sessions) and without configuration doesn't\nguarantee the same level of persistence as Mongo (should the server need to be\nrestarted/crash).\n\nAgenda decides to focus on persistence without requiring special configuration\nof Redis (thereby degrading the performance of the Redis server on non-critical\ndata, such as sessions).\n\nUltimately if enough people want a Redis driver instead of Mongo, I will write\none. (Please open an issue requesting it). For now, Agenda decided to focus on\nguaranteed persistence.\n\n### Spawning / forking processes.\n\nUltimately Agenda can work from a single job queue across multiple machines, node processes, or forks. If you are interested in having more than one worker, [Bars3s](http://github.com/bars3s) has written up a fantastic example of how one might do it:\n\n```js\nvar cluster = require('cluster'),\n    cpuCount = require('os').cpus().length,\n    jobWorkers = [],\n    webWorkers = [];\n\nif (cluster.isMaster) {\n\n    // Create a worker for each CPU\n    for (var i = 0; i < cpuCount; i += 1) {\n        addJobWorker();\n        addWebWorker();\n    }\n\n    cluster.on('exit', function (worker, code, signal) {\n\n        if (jobWorkers.indexOf(worker.id) != -1) {\n            console.log('job worker ' + worker.process.pid + ' died. Trying to respawn...');\n            removeJobWorker(worker.id);\n            addJobWorker();\n        }\n\n        if (webWorkers.indexOf(worker.id) != -1) {\n            console.log('http worker ' + worker.process.pid + ' died. Trying to respawn...');\n            removeWebWorker(worker.id);\n            addWebWorker();\n        }\n    });\n\n} else {\n    if (process.env.web) {\n        console.log('start http server: ' + cluster.worker.id);\n        require('./app/web-http');//initialize the http server here\n    }\n\n    if (process.env.job) {\n        console.log('start job server: ' + cluster.worker.id);\n        require('./app/job-worker');//initialize the agenda here\n    }\n}\n\nfunction addWebWorker() {\n    webWorkers.push(cluster.fork({web: 1}).id);\n}\n\nfunction addJobWorker() {\n    jobWorkers.push(cluster.fork({job: 1}).id);\n}\n\nfunction removeWebWorker(id) {\n    webWorkers.splice(webWorkers.indexOf(id), 1);\n}\n\nfunction removeJobWorker(id) {\n    jobWorkers.splice(jobWorkers.indexOf(id), 1);\n}\n```\n\n# Example Project Structure\n\nAgenda will only process jobs that it has definitions for. This allows you to\nselectively choose which jobs a given agenda will process.\n\nConsider the following project structure, which allows us to share models with\nthe rest of our code base, and specify which jobs a worker processes, if any at\nall.\n\n```\n- server.js\n- worker.js\nlib/\n  - agenda.js\n  controllers/\n    - user-controller.js\n  jobs/\n    - email.js\n    - video-processing.js\n    - image-processing.js\n   models/\n     - user-model.js\n     - blog-post.model.js\n```\n\nSample job processor (eg. `jobs/email.js`)\n\n```js\nvar email = require('some-email-lib'),\n    User = require('../models/user-model.js');\n\nmodule.exports = function(agenda) {\n  agenda.define('registration email', function(job, done) {\n    User.get(job.attrs.data.userId, function(err, user) {\n       if(err) return done(err);\n       email(user.email(), 'Thanks for registering', 'Thanks for registering ' + user.name(), done);\n     });\n  });\n\n  agenda.define('reset password', function(job, done) {\n    // etc etc\n  })\n\n  // More email related jobs\n}\n```\n\nlib/agenda.js\n```js\nvar Agenda = require('agenda');\n\n\nvar agenda = new Agenda(connectionOpts);\n\n\nvar jobTypes = process.env.JOB_TYPES ? process.env.JOB_TYPES.split(',') : [];\n\njobTypes.forEach(function(type) {\n  require('./lib/jobs/' + type)(agenda);\n})\n\nif(jobTypes.length) {\n  agenda.start();\n}\n\nmodule.exports = agenda;\n```\n\nlib/controllers/user-controller.js\n```js\nvar app = express(),\n    User = require('../models/user-model'),\n    agenda = require('../worker.js');\n\napp.post('/users', function(req, res, next) {\n  var user = new User(req.body);\n  user.save(function(err) {\n    if(err) return next(err);\n    agenda.now('registration email', { userId: user.primary() });\n    res.send(201, user.toJson());\n  });\n});\n```\n\nworker.js\n```js\nrequire('./lib/agenda.js');\n```\n\nNow you can do the following in your project:\n\n```\nnode server.js\n```\nFire up an instance with no `JOB_TYPES`, giving you the ability to process jobs,\nbut not wasting resources processing jobs.\n\n```\nJOB_TYPES=email node server.js\n```\nAllow your http server to process email jobs.\n\n\n```\nJOB_TYPES=email node worker.js\n```\n\nFire up an instance that processes email jobs.\n\n```\nJOB_TYPES=video-processing,image-processing node worker.js\n```\n\nFire up an instance that processes video-processing/image-processing jobs. Good\nfor a heavy hitting server.\n\n# Acknowledgements\n\nAgenda has some great community members that help a great deal.\n\n- [@droppedoncaprica](http://github.com/droppedoncaprica)\n- [@nwkeeley](http://github.com/nwkeeley)\n- [@liamdon](http://github.com/liamdon)\n- [@loris](http://github.com/loris)\n\n\n# License\n(The MIT License)\n\nCopyright (c) 2013 Ryan Schmukler <ryan@slingingcode.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the 'Software'), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","maintainers":[{"name":"elmurci","email":"elmurci@gmail.com"}],"time":{"modified":"2022-06-13T02:30:35.576Z","created":"2014-11-03T23:35:16.706Z","0.0.1":"2014-11-03T23:35:16.706Z","0.0.2":"2014-11-06T21:12:44.428Z","0.0.3":"2015-01-04T11:39:45.914Z","0.0.4":"2015-01-04T12:48:46.489Z","0.0.5":"2015-01-05T21:51:28.685Z","0.0.6":"2015-01-07T00:15:29.425Z","0.0.7":"2015-01-13T23:33:32.100Z","0.0.8":"2015-01-14T22:14:25.488Z","0.0.9":"2015-01-18T18:57:56.001Z","0.0.10":"2015-01-18T21:04:29.425Z","0.0.11":"2015-01-20T22:23:30.826Z","0.0.12":"2015-01-24T14:54:21.827Z","0.0.13":"2015-01-26T21:49:12.174Z","1.0.0":"2016-09-09T10:55:53.178Z"},"homepage":"https://github.com/elmurci/agenda-n#readme","keywords":["job","jobs","cron","delayed","scheduler","runner"],"repository":{"type":"git","url":"git://github.com/elmurci/agenda-n.git"},"author":{"name":"Javier Romero","email":"elmurci@gmail.com"},"bugs":{"url":"https://github.com/elmurci/agenda-n/issues"},"license":"MIT","readmeFilename":"README.md","users":{"igorissen":true}}