Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removed sort for now

  • Loading branch information...
commit a86a8c2edfd94c6a99b8ac2afaf93e8ffb8e7505 1 parent 3f979ae
@chriso authored
Showing with 0 additions and 34 deletions.
  1. +0 −34 examples/sort.js
View
34 examples/sort.js
@@ -1,34 +0,0 @@
-var Job = require('node.io').Job;
-
-var options = {
- take: 10000
-};
-
-var temp_files = [];
-
-var methods = {
-
- run: function(lines) {
- lines.sort();
- this.emit(lines);
- },
-
- reduce: function (lines) {
- var self = this, temp_file = '/tmp/' + Math.floor(10000000 * Math.random());
- this.write(temp_file, lines, function () {
- temp_files.push(temp_file);
- self.skip();
- });
- },
-
- complete: function (callback) {
- var self = this;
- this.spawn('sort -m ' + temp_files.join(' '), function (err, stdout, stderr) {
- self.output(stdout.substr(0, stdout.length-1));
- self.exec('rm -f ' + temp_files.join(' '), callback);
- });
- }
-};
-
-//Export the job
-exports.job = new Job(options, methods);
Please sign in to comment.
Something went wrong with that request. Please try again.