admin管理员组

文章数量:1419666

AFAIK meteorjs uses node-fibers, but their github page states that it is server side & v8 only (or is it not ?).

  1. How does meteorjs implement nonblocking, synchronous like api on the client side?

  2. 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 ?).

  1. How does meteorjs implement nonblocking, synchronous like api on the client side?

  2. 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
Add a ment  | 

4 Answers 4

Reset to default 3

The 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