-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b8dd94f
Showing
8 changed files
with
192 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
lib-cov | ||
*.seed | ||
*.log | ||
*.csv | ||
*.dat | ||
*.out | ||
*.pid | ||
*.gz | ||
|
||
pids | ||
logs | ||
results | ||
|
||
npm-debug.log | ||
|
||
/lib | ||
/.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
src/ | ||
.git* | ||
.idea | ||
.project | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
language: node_js | ||
node_js: | ||
- 0.8 | ||
notifications: | ||
email: | ||
recipients: | ||
- lukas@apiary.io | ||
on_success: change | ||
on_failure: always | ||
hipchat: | ||
- secure: "HqBUrmf4P2bgvwb4b9PL1tBae2wcZaXadOgwRwAFhdhDZFHaKXIXlJRUW8tN\ntdO83OZgatxJrpWWQj8VYTfDuhlE3b3NxVWeXc3PkfrHmuvejQf4veh7kwR0\njLVE6jb+ZbFIwRE2W0VFLFKYQHI6PLem4W0OKXW5Shqzy8Ewlow=" | ||
irc: | ||
channels: "irc.freenode.org#apiary" | ||
on_success: always | ||
on_failure: always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
(The MIT License) | ||
|
||
Copyright (c) 2013 Apiary Inc. <support@apiary.io>. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
'Software'), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
## Ivy [![Build Status](https://travis-ci.org/apiaryio/ivy.png?branch=master)](https://travis-ci.org/apiaryio/ivy) | ||
|
||
[Ivy](https://github.com/apiaryio/ivy) is [node.js](http://nodejs.org) queue library focused on easy, yet flexible task execution. | ||
|
||
Assumptions: | ||
|
||
* Shared codebase | ||
* IronMQ (but we want to add other backends) | ||
* Redis for "async task done, resume callback" | ||
|
||
Thoughts: | ||
|
||
* Provide optimalisation for properly decoupled apps that don't need to overuse subscribeTo + closure | ||
|
||
### Installation | ||
|
||
Installation is done via NPM, by running ```npm install ivy``` | ||
|
||
### Features | ||
|
||
* Super easy to use | ||
|
||
|
||
### Quick example | ||
|
||
```javascript | ||
|
||
var ivy = require('ivy'); | ||
|
||
var factorial = function factorial(number, callback) { | ||
callback(null, 42); | ||
} | ||
|
||
var finished = function resolved(result) { | ||
console.log('result is', result); | ||
} | ||
|
||
if (process.env.NODE_ENV==='producer') { | ||
// task must be explicitly registered for now | ||
// we'd like to change that in the future | ||
ivy.registerTask(factorial, { | ||
'name': 'testpackage.factorial', | ||
'queue': 'testpackage' //, | ||
// 'route': 'testpackage.route1', | ||
// 'priority': 0, | ||
// retry: true, | ||
// maxRetries: 10 | ||
}); | ||
|
||
// execute task | ||
ivy.delay(factorial, 5); | ||
|
||
} | ||
elseif (process.env.NODE_ENV==='worker') { | ||
ivy.listen({ | ||
queue: 'testpackage', | ||
|
||
type: 'ironmq', | ||
auth: { | ||
token: process.env.IRONMQ_TOKEN || 'dummy', | ||
project_id: process.env.IRONMQ_PROJECT or 'testpackage' | ||
}, | ||
|
||
// optional | ||
messages: { | ||
'testpackage.factorial': { | ||
reserveTime: 60*60 | ||
} | ||
} | ||
|
||
}); | ||
|
||
} | ||
|
||
ivy.pubsub({ | ||
'type': 'redis', | ||
'url': 'redis://name:password@hostname:port' | ||
}); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
"name": "ivy | ||
"description": "Queue wrapper with node.js-ish interface.", | ||
"version": "0.0.1", | ||
"author": "Apiary Inc <support@apiary.io>", | ||
"contributors": [ | ||
{ | ||
"name": "Lukas Linhart", | ||
"email": "lukas@apiary.io" | ||
} | ||
], | ||
"dependencies": { | ||
"async": "", | ||
"aws-sdk": "" | ||
}, | ||
"devDependencies": { | ||
"coffee-script": "~1.6.3", | ||
"chai": "", | ||
"mocha": "", | ||
"sinon": "" | ||
}, | ||
"keywords": [ | ||
"queue" | ||
], | ||
"scripts": { | ||
"prepublish": "scripts/build", | ||
"test": "./node_modules/.bin/mocha --compilers \"coffee:coffee-script\"" | ||
}, | ||
"licenses": [ | ||
{ | ||
"type": "MIT", | ||
"url": "https://github.com/apiaryio/ivy/blob/master/LICENSE" | ||
} | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "http://github.com/apiaryio/ivy" | ||
}, | ||
"bugs": { | ||
"url": "http://github.com/apiaryio/ivy/issues" | ||
}, | ||
"main": "lib/", | ||
"engines": { | ||
"node": "*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
|
||
if [ -d "src/" ]; then | ||
rm -fr lib/ | ||
node_modules/.bin/coffee -b -c -o lib/ src/ | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = {} |