/
erioxis
/
web-nodejs
Обзор
Документация
Войти
/
erioxis
/
web-nodejs
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
backend/node_modules/fastparallel/example.js
40 строк
883 B
erioxis
lab11fix
15 дек 2025, 23:21
15 дек 2025, 23:21
70dc7ba
Код
Авторство
О чём код?
var parallel = require('./')({ // this is a function that will be called // when a parallel completes released: completed, // we want results and errors // passing false will make it faster! results: true }) parallel( {}, // what will be this in the functions [something, something, something], // functions to call 42, // the first argument of the functions next // the function to be called when the parallel ends ) function something (arg, cb) { setImmediate(cb, null, 'myresult') } function next (err, results) { if (err) { // do something here! } console.log('parallel completed, results:', results) parallel({}, something, [1, 2, 3], done) } function done (err, results) { if (err) { // do something here! } console.log('parallel completed, results:', results) } function completed () { console.log('parallel completed!') }