admin管理员组文章数量:1419666
AFAIK meteorjs uses node-fibers, but their github page states that it is server side & v8 only (or is it not ?).
How does meteorjs implement nonblocking, synchronous like api on the client side?
Is it patible with other browsers than chrome?
I would be very grateful if someone could point me to pure JS implementation of fibers, or explain how do they work (do they have own event loop?).
Any link to a github project of working client side fibers implementation will be also appreciated!
It's XMAS after all :)
AFAIK meteorjs uses node-fibers, but their github page states that it is server side & v8 only (or is it not ?).
How does meteorjs implement nonblocking, synchronous like api on the client side?
Is it patible with other browsers than chrome?
I would be very grateful if someone could point me to pure JS implementation of fibers, or explain how do they work (do they have own event loop?).
Any link to a github project of working client side fibers implementation will be also appreciated!
It's XMAS after all :)
Share Improve this question asked Dec 25, 2012 at 1:10 g00fyg00fy 4,7371 gold badge32 silver badges46 bronze badges 1- This is an excellent question. I actually hadn't even realized it was so. – Alexandre Bourlier Commented May 11, 2016 at 17:10
4 Answers
Reset to default 3The node-fibers project is a Windows-only server-side extension to Node.js, implemented in C++. You may never ever see it available in a web browser.
JavaScript is single threaded. If you wanted to implement non-blocking I/O, you would have to implement a node-style message loop and an asynchronous I/O library. By default, all client side I/O is synchronous, though Meteor and other libraries have provisions for callbacks.
Yes, Meteor's client-side implementation runs across multiple browsers besides Chrome.
Try JSCEX (Windjs)
Wind.js is an advanced library which enable us to control flow with plain JavaScript for asynchronous programming (and more) without additional pre-piling steps.
It worked for both server side AND client side.
I believe on the server side, everything is purely synchronous with Meteor, thanks to MiniMongo. Thus no asynchronous callback is needed, or to be more precise, Meteor doesn't need to wait for the update
callback from the server to go on to the next instruction, thanks to MiniMongo which responds synchronously.
I haven't verified everything I have just said by looking into the source code, but I can't imagine how it could work differently.
EDIT
Still haven't dived into the source code yet, but this section of the Meteor's guide seems to head the way I thought.
本文标签: meteorClient Side Implementation of Fibers in JavaScriptStack Overflow
版权声明:本文标题:meteor - Client Side Implementation of Fibers in JavaScript. - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745315962a2653155.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论