Skip to content

Instantly share code, notes, and snippets.

@iMichaelOwolabi
Last active February 13, 2022 20:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iMichaelOwolabi/c2d217385d1bdcbc6bdc19e512c358d3 to your computer and use it in GitHub Desktop.
Save iMichaelOwolabi/c2d217385d1bdcbc6bdc19e512c358d3 to your computer and use it in GitHub Desktop.
Sample event loop blocking code
/**
* Event loop blocking code sample
*/
const fs = require('fs');
const countries = fs.readFileSync('countries.csv');
console.log(countries.toString());
// Other JavaScript code below this line will be blocked until the file reading completes.
console.log('Other JAVASCRIPT THAT IS BLOCKED');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment