Permalink
Browse files

bump to 0.7.0

  • Loading branch information...
1 parent 5c43477 commit 356a31473824ae93a55e713adb9b29932c26cc1b @behrad behrad committed Jan 20, 2014
Showing with 3,574 additions and 1,186 deletions.
  1. 0 .gitignore
  2. 0 .npmignore
  3. 0 .travis.yml
  4. 0 History.md
  5. +19 −19 Makefile
  6. 0 Readme.md
  7. +14 −19 examples/delayed.js
  8. +32 −35 examples/events.js
  9. +17 −21 examples/many.js
  10. +18 −19 examples/shutdown.js
  11. +30 −33 examples/stale.js
  12. +23 −26 examples/video.js
  13. +0 −1 index.js
  14. +10 −10 lib/http/index.js
  15. +5 −6 lib/http/middleware/provides.js
  16. BIN lib/http/public/images/bg.jpg
  17. +195 −194 lib/http/public/javascripts/caustic.js
  18. +170 −171 lib/http/public/javascripts/job.js
  19. +19 −18 lib/http/public/javascripts/jquery.ext.js
  20. +2,455 −1 lib/http/public/javascripts/jquery.min.js
  21. +50 −51 lib/http/public/javascripts/loading.js
  22. +151 −151 lib/http/public/javascripts/main.js
  23. +55 −56 lib/http/public/javascripts/progress.js
  24. +18 −19 lib/http/public/javascripts/search.js
  25. +25 −34 lib/http/public/javascripts/utils.js
  26. +1 −2 lib/http/public/stylesheets/actions.styl
  27. +0 −1 lib/http/public/stylesheets/config.styl
  28. +0 −1 lib/http/public/stylesheets/context-menu.styl
  29. +1 −1 lib/http/public/stylesheets/error.styl
  30. +2 −3 lib/http/public/stylesheets/job.styl
  31. +1 −2 lib/http/public/stylesheets/main.styl
  32. +1 −2 lib/http/public/stylesheets/menu.styl
  33. +0 −1 lib/http/public/stylesheets/mixins.styl
  34. +0 −1 lib/http/public/stylesheets/scrollbar.styl
  35. +10 −12 lib/http/routes/index.js
  36. +128 −128 lib/http/routes/json.js
  37. +3 −3 lib/http/views/_filter.jade
  38. +43 −43 lib/http/views/_job.jade
  39. +20 −21 lib/http/views/_menu.jade
  40. +2 −2 lib/http/views/_row.jade
  41. 0 lib/http/views/_search.jade
  42. +3 −3 lib/http/views/_sort.jade
  43. +6 −6 lib/http/views/job/list.jade
  44. +25 −25 lib/http/views/layout.jade
  45. +3 −25 lib/kue.js
  46. 0 lib/queue/events.js
  47. 0 lib/queue/job.js
  48. +8 −9 lib/queue/pool.js
  49. +3 −3 lib/queue/worker.js
  50. +7 −7 lib/redis.js
  51. +1 −1 package.json
  52. 0 test/mocha.opts
  53. 0 test/test.coffee
View
0 .gitignore 100644 → 100755
No changes.
View
0 .npmignore 100644 → 100755
No changes.
View
0 .travis.yml 100644 → 100755
No changes.
View
0 History.md 100644 → 100755
No changes.
View
38 Makefile 100644 → 100755
@@ -3,32 +3,32 @@ REPORTER = spec
all: build
build:
- @./node_modules/coffee-script/bin/coffee \
- -c \
- -o lib src
+ @./node_modules/coffee-script/bin/coffee \
+ -c \
+ -o lib src
test-tdd:
- @./node_modules/.bin/mocha \
- --reporter $(REPORTER) \
- --ui tdd \
- test/tdd/*.js
+ @./node_modules/.bin/mocha \
+ --reporter $(REPORTER) \
+ --ui tdd \
+ test/tdd/*.js
test-bdd:
- @./node_modules/.bin/mocha \
- --reporter $(REPORTER) \
- --require should \
- --ui bdd \
- test/*.js
+ @./node_modules/.bin/mocha \
+ --reporter $(REPORTER) \
+ --require should \
+ --ui bdd \
+ test/*.js
test-bdd-coffee:
- @./node_modules/.bin/mocha \
- --compilers coffee:coffee-script \
- --reporter $(REPORTER) \
- --require should \
- --ui bdd \
- test/*.coffee
+ @./node_modules/.bin/mocha \
+ --compilers coffee:coffee-script \
+ --reporter $(REPORTER) \
+ --require should \
+ --ui bdd \
+ test/*.coffee
test-all: test-bdd test-tdd test-bdd-coffee
-.PHONY: test-all
+.PHONY: test-all
View
0 Readme.md 100644 → 100755
No changes.
View
33 examples/delayed.js 100644 → 100755
@@ -1,4 +1,3 @@
-
var kue = require('../');
// create our job queue
@@ -10,36 +9,32 @@ var jobs = kue.createQueue();
var minute = 60000;
var email = jobs.create('email', {
- title: 'Account renewal required'
- , to: 'tj@learnboost.com'
- , template: 'renewal-email'
+ title: 'Account renewal required', to: 'tj@learnboost.com', template: 'renewal-email'
}).delay(minute)
- .priority('high')
- .save();
+ .priority('high')
+ .save();
-email.on('promotion', function(){
- console.log('renewal job promoted');
+email.on('promotion', function () {
+ console.log('renewal job promoted');
});
-email.on('complete', function(){
- console.log('renewal job completed');
+email.on('complete', function () {
+ console.log('renewal job completed');
});
jobs.create('email', {
- title: 'Account expired'
- , to: 'tj@learnboost.com'
- , template: 'expired-email'
+ title: 'Account expired', to: 'tj@learnboost.com', template: 'expired-email'
}).delay(minute * 10)
- .priority('high')
- .save();
+ .priority('high')
+ .save();
jobs.promote();
-jobs.process('email', 10, function(job, done){
- setTimeout(function(){
- done();
- }, Math.random() * 5000);
+jobs.process('email', 10, function (job, done) {
+ setTimeout(function () {
+ done();
+ }, Math.random() * 5000);
});
// start the UI
View
67 examples/events.js 100644 → 100755
@@ -1,4 +1,3 @@
-
var kue = require('../');
// create our job queue
@@ -13,49 +12,47 @@ var jobs = kue.createQueue();
// user input etc.
function create() {
- var name = ['tobi', 'loki', 'jane', 'manny'][Math.random() * 4 | 0];
- var job = jobs.create('video conversion', {
- title: 'converting ' + name + '\'s to avi'
- , user: 1
- , frames: 200
- });
-
- job.on('complete', function(){
- console.log(" Job complete");
- }).on('failed', function(){
- console.log(" Job failed");
- }).on('progress', function(progress){
- process.stdout.write('\r job #' + job.id + ' ' + progress + '% complete');
- });
-
- job.save();
-
- setTimeout(create, Math.random() * 2000 | 0);
+ var name = ['tobi', 'loki', 'jane', 'manny'][Math.random() * 4 | 0];
+ var job = jobs.create('video conversion', {
+ title: 'converting ' + name + '\'s to avi', user: 1, frames: 200
+ });
+
+ job.on('complete',function () {
+ console.log(" Job complete");
+ }).on('failed',function () {
+ console.log(" Job failed");
+ }).on('progress', function (progress) {
+ process.stdout.write('\r job #' + job.id + ' ' + progress + '% complete');
+ });
+
+ job.save();
+
+ setTimeout(create, Math.random() * 2000 | 0);
}
create();
// process video conversion jobs, 1 at a time.
-jobs.process('video conversion', 1, function(job, done){
- var frames = job.data.frames;
-
- function next(i) {
- // pretend we are doing some work
- convertFrame(i, function(err){
- if (err) return done(err);
- // report progress, i/frames complete
- job.progress(i, frames);
- if (i >= frames) done()
- else next(i + Math.random() * 10);
- });
- }
-
- next(0);
+jobs.process('video conversion', 1, function (job, done) {
+ var frames = job.data.frames;
+
+ function next(i) {
+ // pretend we are doing some work
+ convertFrame(i, function (err) {
+ if (err) return done(err);
+ // report progress, i/frames complete
+ job.progress(i, frames);
+ if (i >= frames) done()
+ else next(i + Math.random() * 10);
+ });
+ }
+
+ next(0);
});
function convertFrame(i, fn) {
- setTimeout(fn, Math.random() * 50);
+ setTimeout(fn, Math.random() * 50);
}
// start the UI
View
38 examples/many.js 100644 → 100755
@@ -1,46 +1,42 @@
-
var kue = require('../')
- , express = require('express');
+ , express = require('express');
// create our job queue
var jobs = kue.createQueue();
function create() {
- var name = ['tobi', 'loki', 'jane', 'manny'][Math.random() * 4 | 0];
- jobs.create('video conversion', {
- title: 'converting ' + name + '\'s to avi'
- , user: 1
- , frames: 200
- }).save();
- setTimeout(create, Math.random() * 3000 | 0);
+ var name = ['tobi', 'loki', 'jane', 'manny'][Math.random() * 4 | 0];
+ jobs.create('video conversion', {
+ title: 'converting ' + name + '\'s to avi', user: 1, frames: 200
+ }).save();
+ setTimeout(create, Math.random() * 3000 | 0);
}
create();
function create2() {
- var name = ['tobi', 'loki', 'jane', 'manny'][Math.random() * 4 | 0];
- jobs.create('email', {
- title: 'emailing ' + name + ''
- , body: 'hello'
- }).save();
- setTimeout(create2, Math.random() * 1000 | 0);
+ var name = ['tobi', 'loki', 'jane', 'manny'][Math.random() * 4 | 0];
+ jobs.create('email', {
+ title: 'emailing ' + name + '', body: 'hello'
+ }).save();
+ setTimeout(create2, Math.random() * 1000 | 0);
}
create2();
// process video conversion jobs, 3 at a time.
-jobs.process('video conversion', 2, function(job, done){
- console.log('video');
- setTimeout(done, Math.random() * 5000);
+jobs.process('video conversion', 2, function (job, done) {
+ console.log('video');
+ setTimeout(done, Math.random() * 5000);
});
// process 10 emails at a time
-jobs.process('email', 10, function(job, done){
- console.log('email');
- setTimeout(done, Math.random() * 2000);
+jobs.process('email', 10, function (job, done) {
+ console.log('email');
+ setTimeout(done, Math.random() * 2000);
});
// start the UI
View
37 examples/shutdown.js 100644 → 100755
@@ -1,35 +1,34 @@
-
var kue = require('../')
var jobs = kue.createQueue()
function generateJobs() {
- for (var i=0; i<12; i++) {
- console.log('Creating Job #' + i);
- jobs.create('long render', {
- title: 'rendering frame #' + i
- }).save();
- }
+ for (var i = 0; i < 12; i++) {
+ console.log('Creating Job #' + i);
+ jobs.create('long render', {
+ title: 'rendering frame #' + i
+ }).save();
+ }
}
-jobs.process('long render', 4, function(job, done) {
- console.log('Starting ' + job.data.title);
- setTimeout(function() {
- console.log('Finished ' + job.data.title);
- done();
- }, 3000);
+jobs.process('long render', 4, function (job, done) {
+ console.log('Starting ' + job.data.title);
+ setTimeout(function () {
+ console.log('Finished ' + job.data.title);
+ done();
+ }, 3000);
})
generateJobs();
-setTimeout(function() {
- console.log('[ Shutting down when all jobs finish... ]');
- jobs.shutdown(function(err) {
- console.log('[ All jobs finished. Kue is shut down. ]');
- process.exit(0);
- })
+setTimeout(function () {
+ console.log('[ Shutting down when all jobs finish... ]');
+ jobs.shutdown(function (err) {
+ console.log('[ All jobs finished. Kue is shut down. ]');
+ process.exit(0);
+ })
}, 4200)
Oops, something went wrong.

0 comments on commit 356a314

Please sign in to comment.