Questions tagged [node-fibers]

A fiber is a particularly lightweight kernel thread scheduler dependent thread of execution using co-operative multitasking.

A fiber is a particularly lightweight thread of execution.

Like threads, fibers share address space. However, fibers use co-operative multitasking while threads use pre-emptive multitasking. Threads often depend on the kernel's thread scheduler to preempt a busy thread and resume another thread; fibers yield themselves to run another fiber while executing.

node-fiber introduces Fiber support for v8 and Node JS

Source: Wikipedia

114 questions
141
votes
9 answers

How to wrap async function calls into a sync function in Node.js or Javascript?

Suppose you maintain a library that exposes a function getData. Your users call it to get actual data: var output = getData(); Under the hood data is saved in a file so you implemented getData using Node.js built-in fs.readFileSync. It's obvious…
abbr
  • 5,361
  • 6
  • 30
  • 44
38
votes
3 answers

"Meteor code must always run within a Fiber" when calling Collection.insert on server

I have the following code in server/statusboard.js; var require = __meteor_bootstrap__.require, request = require("request") function getServices(services) { services = []; …
Andrew Beresford
  • 566
  • 1
  • 4
  • 11
26
votes
1 answer

Why does ESLint trigger lint errors on while(true) using fibers?

I have come JS code with some infinite loops (we're using node-fibers to allow things to happen). ESLint hates: while (true) { } because of the constant condition. The following is allowed though: for(;;) { } Beyond just feeding the lintbeast,…
Dancrumb
  • 26,597
  • 10
  • 74
  • 130
18
votes
2 answers

Why is meteor.js synchronous?

Doesn't code take an efficiency hit by being synchronous? Why is coding synchronously a win? I found these two links in doing some research: http://bjouhier.wordpress.com/2012/03/11/fibers-and-threads-in-node-js-what-for/,…
Matt
  • 5,553
  • 5
  • 24
  • 32
16
votes
9 answers

npm install fibers shows error

When i try to install fibers using npm install fibers i've got following error, Also i tried with other solutions in the stack overflow but none of them is helped, please help Iam using OSX 10.8.5 > fibers@1.0.1 install…
Jan
  • 1,744
  • 3
  • 23
  • 38
16
votes
1 answer

What's going on with Meteor and Fibers/bindEnvironment()?

I am having difficulty using Fibers/Meteor.bindEnvironment(). I tried to have code updating and inserting to a collection if the collection starts empty. This is all supposed to be running server-side on startup. function insertRecords() { …
tropicalmug
  • 225
  • 1
  • 2
  • 6
11
votes
1 answer

Getting error while installing fibers@2.0.2

I'm working on an old node project and while doing npm install I'm getting errors Node version: v13.8.0 Npm version: 6.14.4 Mac OS Version: 10.15.5 At first, I was getting the X-Code issue that I have fixed after re-installing the X-Code. The issue…
groot
  • 420
  • 1
  • 7
  • 15
11
votes
2 answers

node.js fibers with pg/postgres

I've been trying to figure out how to use node-fibers to make my database code less messy in node.js, but I can't get it to work. I boiled the code down to this as a minimum test case: var Future = require('fibers/future'); var…
Erik
  • 125
  • 8
10
votes
1 answer

What do fibers/future actually do?

What does the line of code below do? Npm.require('fibers/future'); I looked online for examples and I came across a few like this: Future = Npm.require('fibers/future'); var accessToken = new Future(); What will accessToken variable be in this…
user3420180
  • 254
  • 2
  • 9
9
votes
2 answers

Fetching items from a Meteor collection on the server throws "Can't wait without Fiber"

I'm making a fairly simple meteor app for the first time that is supposed to query all of the git issues from a certain repo. After it gets a list of issues from the github api, the idea is to create a collection of tasks from these issues. …
Fenster
  • 340
  • 3
  • 9
8
votes
4 answers

Problems with Meteor deployment related to fibers module

While trying to deploy meteor, I install node fiber by: $ cd bundle/server and then installing fiber $ npm install fibers It seems to install but with this message: `linux-x64-v8-3.14` exists; testing Binary is fine; exiting fibers@1.0.1…
Anshuman Biswas
  • 789
  • 9
  • 21
6
votes
3 answers

Tracking down stack overflow in meteor/node fiber

I'm seeing this crash now and am not familiar enough with the node fiber infrastructure to know where to begin interpreting the error or instrumenting the code... Meteor server running on: http://localhost:3000/ W202407-10:06:05.740(-8)? (STDERR)…
Ben
  • 4,980
  • 3
  • 43
  • 84
6
votes
4 answers

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 ?). How does meteorjs implement nonblocking, synchronous like api on the client side? Is it compatible with other browsers than chrome? I…
g00fy
  • 4,717
  • 1
  • 30
  • 46
5
votes
2 answers

Nodejs (Sync) cannot find fibers binaries

I've seen similar questions but no real solution that worked for me yet (most users just reinstall fibers or meteor (I'm not using meteor)). I've added the nodejs module Sync to my nodejs 0.12.6 project. It's dependency is the Fibers module that got…
Florian Brinker
  • 735
  • 7
  • 17
5
votes
1 answer

Writing/Converting Meteor Synchronous Functions

This has been bothering me for a while so I thought I'd just do a quick QA on it: If one has a normal nodeJS module or something and it has a async function on the server side. How do I make it synchronous. E.g how would I convert the nodejs fs.stat…
Tarang
  • 75,157
  • 39
  • 215
  • 276
1
2 3 4 5 6 7 8