Last active
August 29, 2015 14:25
-
-
Save wearhere/cee5cd0b5fd01f859126 to your computer and use it in GitHub Desktop.
Fiber-using code before refactoring. 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.fiber(function() { | |
var data = sync.await(fs.readFile('a.txt', sync.defer())); | |
var processedData = /* do something with the data */; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment