Created
September 2, 2014 21:57
-
-
Save oscarmcm/b40e481cd1e852457307 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
{ | |
"name": "HelloWorld", | |
"author": "Oscar Cortez", | |
"version": "0.0.1", | |
"description": "Agenda Sample Application", | |
"dependencies": { | |
"agenda": "*" | |
}, | |
"engine": "node 0.10.x" | |
} |
This file contains hidden or 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
Agenda = require('agenda'); | |
var agenda = new Agenda({db: {address: 'localhost:27017/agenda-example'}}); | |
agenda.define('greet the world', function(job, done) { | |
console.log(job.attrs.data.time, 'hello world!'); | |
done(); | |
}); | |
agenda.schedule('in 10 seconds', 'greet the world', {time: new Date()}); | |
agenda.start(); | |
console.log('Wait 10 seconds...'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
bad
Agenda = require('agenda');
Good
var Agenda = require('agenda');