首页 > Web开发 > 详细

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

时间:2020-12-31 14:41:53      阅读:43      评论:0      收藏:0      [点我收藏+]

使用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

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

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!