AirJD 焦点
AirJD

没有录音文件
00:00/00:00
加收藏

JavaScript on Fiber by 庄恒飞@那么社区

发布者 noder
发布于 1438747980756  浏览 4874 关键词 node, JavaScript, 框架 
分享到

第1页

那么社区-庄恒⻜飞 http://named.cn



第2页

What is fibs ?

• Javascript Platform • Based on V8 • Non-Blocking • Fiber-Driven • NO CallBack



第3页

How to install it ?

brew install fibjs http://fibjs.org



第4页

What’s the difference ?



第5页

Demo



第6页

Node.js : Fibjs :



第7页

Pretty Cool!



第8页

How does it works ?



第9页

Current fiber pending, Javascript switch to next waiting fiber。When the

pending fiber’s job has been done,it will be added to the waiting queue.



第10页

JS Thead



Work Thead Pool



IO Thead



第11页

JS Thead



Work Thead Pool



IO Thead



第12页

Work Thead Pool • Sync IO. (file)

• Compute Intensive.(Encryption,Compression,

image…)

• Async Logic.(Protocol processing)



第13页

Improve the utilization of JS Thread



第14页

Experience Sharing

• Module • Parallel

• Hot Upgrade • Transplant npm package



第15页

Module System

• CommonJS • Asynchronous Require(unlike node.js) • exports&module are valid, only when required • exports cloned object

• .module(similar to node_modules)



第16页

Parallel

• coroutine.parallel



第17页

Hot Upgrade

Demo



第18页

Transplant npm package

• Pure JS library, direct use。 • Node async API, modify to fibjs API • Create your owen lib ,based on fiber!



第19页

Conclusion

• Simple • Completely Asynchronous • No CallBack • Powerful



第20页

Try it now!



第21页

Q/A



第22页

Thank!



支持文件格式:*.pdf
上传最后阶段需要进行在线转换,可能需要1~2分钟,请耐心等待。