Browse files

fix examples: no parallels anymore

  • Loading branch information...
1 parent 5c5fa3e commit 5c88e9b7bef72cc452c7e5dab0a99bf654388e84 @ybogdanov committed Feb 11, 2013
Showing with 6 additions and 5 deletions.
  1. +6 −5 examples/exceptions.js
View
11 examples/exceptions.js
@@ -53,17 +53,18 @@ someSyncFunction(__filename, function(err, source){
})
/**
- * Exceptions inside of a Sync.Parallel
- * see examples/parallel.js for more details about Sync.Parallel
+ * Exceptions inside of a Sync.Future
+ * see examples/future.js for more details about Sync.Future
*/
Sync(function(){
// Here we need to call someAsyncFunction two times with different arguments in parallel
// but wait for both results and only then continue
try {
- var results = Sync.Parallel(function(callback){
- someAsyncFunction(2, 2, callback());
- });
+ var result1 = someAsyncFunction.future(null, 2, 2),
+ result2 = someAsyncFunction.future(null, 3, 3);
+ result1.yield();
+ result2.yield();
}
catch (e) {
console.error(e); // will print 'something went wrong' after 1 sec

0 comments on commit 5c88e9b

Please sign in to comment.