使用throng 加速nodejs 应用的并行执行能力

时间:2020-12-31 14:41:53   收藏:0   阅读:44

使用throng 可以简化nodejs 的多cpu任务执行处理,代码简洁
基于worker_threads 也是一个不错的选择

参考使用

 
const throng = require(‘throng‘)
throng(id => console.log(`Started worker ${id}`))

说明

throng 还是比较强大,内部基于了node 的cluster

参考资料

https://github.com/hunterloftis/throng
https://github.com/pioardi/poolifier
https://cube.dev/blog/jobber-runs-on-cubejs/
https://devcenter.heroku.com/articles/node-concurrency

原文:https://www.cnblogs.com/rongfengliang/p/14215516.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!