← Winnitude! Search  ·  Reader Mode (1312 ms)
Links: Stay in Reader Retro Site Converter Retro Mode: OFF Original Page ↗
GITHUB · 46 LINKS

AsynchronousProgramming/JavaScript at master · HowProgrammingWorks/AsynchronousProgramming

Repository navigation

JavaScript

Directory actions

More options

Directory actions

More options

Latest commit

 

History


History
View commit history for this file.

JavaScript

Folders and files

Name Name Last commit message Last commit date

parent directory

..
1-sequential-callbacks.js 1-sequential-callbacks.js    
2-emulate-async-calls.js 2-emulate-async-calls.js    
3-back-to-order.js 3-back-to-order.js    
4-step-by-step.js 4-step-by-step.js    
5-chain.js 5-chain.js    
5a-chain.js 5a-chain.js    
5b-chain.js 5b-chain.js    
6-promise-sequential.js 6-promise-sequential.js    
7-promise-all.js 7-promise-all.js    
8-promise-mixed.js 8-promise-mixed.js    
9-events.js 9-events.js    
README.md README.md    
a-to-async.js a-to-async.js    
b-sync-to-promise.js b-sync-to-promise.js    
c-promisify.js c-promisify.js    
d-asyncjs-map.js d-asyncjs-map.js    
e-asyncjs-parallel.js e-asyncjs-parallel.js    
f-asyncjs-series.js f-asyncjs-series.js    
g-async-await.js g-async-await.js    
package-lock.json package-lock.json    
package.json package.json    

README.md

AsynchronousProgramming

See four examples and execute them. Create asynchronous analogues of Array.forEach

Parallel execution

// Array of functions
let fns = [readConfig, selectFromDb, getHttpPage, readFile];

// Call example
parallelAsync(fns, () => { console.log('Done'); });

// Implementation
function parallelAsync(fns, done) {
  // TODO: implement parallel ecexution
};

Sequential execution

// Array of functions
let fns = [readConfig, selectFromDb, getHttpPage, readFile];

// Call example
sequentialAsync(fns, () => { console.log('Done'); });

// Implementation
function sequentialAsync(fns, done) {
  // TODO: implement sequential execution
};