Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Client Side Implementation of Fibers in JavaScript.

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 compatible 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 :)

like image 598
g00fy Avatar asked Dec 25 '12 01:12

g00fy


2 Answers

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.

like image 89
Pointy Avatar answered Nov 12 '22 01:11

Pointy


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.

like image 22
David Wihl Avatar answered Nov 12 '22 01:11

David Wihl