2

Meteor makes heavy use of fibers with each client's requests running in a separate fiber, but what does this actually do?

From reading around the advantage of fibers seems to be that they let you write asynchronous code in a synchronous manner. Is that all they do?

Also, how does this.unblock() work in methods? The docs say: 'In Meteor, your server code runs in a single thread per request, not in the asynchronous callback style typical of Node.'

How does fibers mimic threads, while not actually being a thread? If a Meteor method performs a long computation, how does it not block the event loop?

Eliezer Steinbock
  • 4,728
  • 5
  • 31
  • 43
  • AFAIK this line in the Meteor docs is pure bull poop. Meteor is single-threaded natively, what they mean by "thread" is instead a "Fiber". I am afraid explaining the whole concept of Fibers is a bit too much for a StackOverflow question. – Kyll Aug 30 '15 at 10:45

0 Answers0