Skip to content

Instantly share code, notes, and snippets.

@andrewtamura
Created July 22, 2015 21:12
Show Gist options
  • Save andrewtamura/6ca09e57d28fdf50cf71 to your computer and use it in GitHub Desktop.
Save andrewtamura/6ca09e57d28fdf50cf71 to your computer and use it in GitHub Desktop.
var sync = require('synchronize');
sync.fiber(function() {
try {
sync.await(func1(sync.defer()));
console.log('hits');
} catch (e) {
console.log('exception');
}
});
var func1 = function() {
sync.fiber(function() {
sync.await(func2(sync.defer()));
}, done);
};
var func2 = function() {
sync.fiber(function() {
sync.await(func3(sync.defer()));
}, done);
};
var func3 = function(done) {
done('error');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment