CNode

Run your codes in background js or extend node by c++ closures

分享
Cclassfellow发布于11 年前最后回复11 年前0 回复3680 浏览0 收藏

rcib

RCIB(running codes in background js) is a node.js package for providing ability to run js codes in background or a way to extend node.js by C++ closures.

RCIB relove cpu-bound tasks for node.js, it works as follow picture: you use it like this:

rcib-interpret.png

rcib.postTask( path.join(__dirname, './background.js'), 'globalFunction2', JSON.stringify({a:100, b: 200}), function (err, value) { if(err) console.error(err) else console.log(value) })

globalFunction2 is a CPU-intensive work in background js, it runs in other thread, when finished ,callback will run in main loop.

查看回复

回复 (0)

暂无回复,成为第一个参与讨论的人。
参与回复
登录后即可参与回复。登录