Created
July 22, 2015 21:12
-
-
Save andrewtamura/6ca09e57d28fdf50cf71 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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