Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename from
callbackLocation
to gate_location
. Update examples.
- Loading branch information
1 parent
a8b41c9
commit e8fe5d9
Showing
9 changed files
with
39 additions
and
38 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
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
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 |
---|---|---|
@@ -1,14 +1,14 @@ | ||
var gate = require('../index'); | ||
var fs = require('fs'); | ||
|
||
var latch = gate.latch(); | ||
fs.readFile('file1', 'utf8', latch({name: 'file1', data: 1})); | ||
fs.readFile('non-existent', 'utf8', latch({name: 'non-existent', data: 1})); | ||
var g = gate.create(); | ||
fs.readFile('file1', 'utf8', g.latch({name: 'file1', data: 1})); | ||
fs.readFile('non-existent', 'utf8', g.latch({name: 'non-existent', data: 1})); | ||
|
||
latch.await(function (err, results) { | ||
g.await(function (err, results) { | ||
if (err) { | ||
console.log(err + ', callbackLocation: ' + err.callbackLocation); | ||
console.log(err + ', gate_location: ' + err.gate_location); | ||
} else { | ||
console.log(results); | ||
} | ||
}); | ||
}); |
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
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
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
var gate = require('../index'); | ||
|
||
var latch = gate.latch(); | ||
setTimeout(latch({val: 'a'}), 30); | ||
setTimeout(latch({val: 'b'}), 20); | ||
setTimeout(latch({val: 'c'}), 10); | ||
var g = gate.create(); | ||
setTimeout(g.latch({val: 'a'}), 30); | ||
setTimeout(g.latch({val: 'b'}), 20); | ||
setTimeout(g.latch({val: 'c'}), 10); | ||
|
||
latch.await(function (err, results) { | ||
g.await(function (err, results) { | ||
if (err) throw err; | ||
console.log(results); | ||
}); |
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
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
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