Why Fibers Make Sense For Meteor
summary
Meteor uses co-routines (fibers) to let server code call async operations as if they were synchronous, implemented with node-fibers/Libkuro to swap stacks so yield/run can suspend and resume call stacks. The talk claims async/await can be implemented as two library functions built on fibers, and shows it working in Meteor; benefits are improved learnability, maintainability, and optional parallelism. Remaining problems: simulating fibers in browsers is impractical, shared mutable globals (filesystem) need guards like noYieldsAllowed, and native-module compatibility risks.
AI-written summary · about
chapters (14)
- 0:00Start
- 8:22What Is a Fiber or a Co-Routine
- 9:30The Way the Fibers Api Works
- 11:54Why Not Javascript
- 16:48Callbacks
- 20:38Async
- 25:44How Meteor Allows Database Access on the Client
- 27:27How Should Meteor Allow Database Access on the Client
- 28:26Co-Routines
- 32:20Simulating Fibers in the Browser
- 35:42Omnipresent File System
- 36:18File System Code with Fibers at Meteor
- 37:57Ensure Compatibility with Fibers
- 39:30Learnability
related talks
35mAlgebraic effects, Fibers, Coroutines...Oh my!
22mInside Fiber: the In-Depth Overview You Wanted a TLDR for
43mMeteor - What is it, and should I use it or not?
31mA Cartoon Intro to React Fiber
42mBeyond Promises: Async Patterns in JavaScript
33mAsync Functions Awaiting You
22mDon’t Try This at Home: Synchronous I/O in Node.js
40mEvented Ruby vs Node.js
