Created
July 22, 2015 19:44
-
-
Save wearhere/5a8cb95af221b84eecc5 to your computer and use it in GitHub Desktop.
Making an asynchronous method fiber-aware so that it can be called without a callback. More info at https://www.mixmax.com/blog/node-fibers-using-synchronize-js.
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
sync(fs, 'readFile'); | |
sync.fiber(function() { | |
var data = fs.readFile('a.txt'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment