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
4
votes
2 answers

npm ERR! fibers@1.0.15 install: `node build.js || nodejs build.js`

I'm trying to install Sunbird on my laptop by referring document. But getting error on npm install step gyp WARN install got an error, rolling back install gyp ERR! configure error gyp ERR! stack Error: unexpected end of file gyp ERR! stack at…
Amol Ghatol
  • 179
  • 3
  • 8
4
votes
1 answer

Node.js module "fibers" not taking the correct version

I'm pretty new to node.js and its package management system and its require. I'm having trouble with the following runtime error I'm getting after having installed a bunch of packages with npm install: ERROR: Couldn't initialise framework…
e.dan
  • 7,275
  • 1
  • 26
  • 29
4
votes
3 answers

How to use fibers with streams

I am trying to use fibers with streams: var Fiber = require('fibers'); var Future = require('fibers/future'); var fs = require('fs'); function sleepForMs(ms) { var fiber = Fiber.current; setTimeout(function() { fiber.run(); }, ms); …
Mitar
  • 6,756
  • 5
  • 54
  • 86
4
votes
0 answers

How to block the main thread until one or multiple fibers finish?

I use the fibers package for node.js. Suppose I create several fibers, and want to wait in the main thread for any one of them to finish. The API for the Fiber object only lists non-blocking functions like run. The Future object doesn't seem to be…
dragonroot
  • 5,653
  • 3
  • 38
  • 63
4
votes
4 answers

How to call async method from Meteor own callbacks?

I've just spent a few hours reading SO with answers such as Meteor: Calling an asynchronous function inside a Meteor.method and returning the result Unfortunately, I still didn't manage to user fibers, or futures for that matter. I'm trying to do…
Stephan Tual
  • 2,617
  • 3
  • 27
  • 49
3
votes
0 answers

Microsoft.cpp.default.props not found when running npm install

There are many issues related to this subject however I have tried all of the following solutions to no avail: npm install -g --production windows-build-tools /*and*/ npm config set msvs_version 2015 install Visual Studio Build Tools (both 8.1 and…
Ben Hawkins
  • 31
  • 1
  • 7
3
votes
1 answer

how to solve "Failed at the fibers@2.0.0 install script' error while deploying the meteor app?

I know how to package and then deploy meteor application. But recently for one project i'm stuck at an error which i couldn't resolve. Steps I followed for package and deploy of my meteor app: 1. meteor build package 2. cd package 3.…
Snkini
  • 571
  • 1
  • 5
  • 16
3
votes
1 answer

Why does an insert() break wrapAsync'd child_process.spawn() handlers in a Meteor method?

I'm trying to use child_process.spawn() in a Meteor method. I want to capture the PID, stdout, stderr, and exit code from an external process, and store all that in the database. Everything worked until I added that first insert() call. With that…
Adam Monsen
  • 9,054
  • 6
  • 53
  • 82
3
votes
1 answer

Return value from node.js fiber future

In the following piece of code the fiber works as expected ("1" and "2" are printed 2 seconds apart). But, I want to return "3" from fiberFunction and print that synchronously. This doesn't work though.Here is the output: 1 Temp: undefined 2 Does…
3
votes
1 answer

"Fatal error" inside V8 during GC when using node-fibers in node.js

I'm running into a fatal error reported by V8 when running the following program: var Fiber = require("fibers"); Fiber(function () {}); global.gc(); The command used to run it: > node --expose-gc scratch.js The text of the fatal error is as…
Stefan Dragnev
  • 14,143
  • 6
  • 48
  • 52
3
votes
2 answers

Node.js, Synchronize.js and return values

I'm using this wonderful sync module, synchronize.js - http://alexeypetrushin.github.io/synchronize/docs/index.html. I've run into a situation where I have to get the return value of the sync'd function into the scope outside of the fiber. Here's a…
shellscape
  • 840
  • 1
  • 6
  • 17
3
votes
1 answer

'Meteor code must always run within a Fiber' error when using NPM package

I'm using Meteor.require('npmPackage') to use a NPM package. However I seem to be getting an error when writing to mongo in npm package's callback function. Error: Error: Meteor code must always run within a Fiber. Try wrapping callbacks that you…
Nyxynyx
  • 61,411
  • 155
  • 482
  • 830
3
votes
2 answers

How to run code using Node.js Fibers

I have a question about Nodejs Fibers(which is absolute new for me) ... I have this tutorial for Nodejs Fibers, http://bjouhier.wordpress.com/2012/03/11/fibers-and-threads-in-node-js-what-for/, and there was an example in here it says var fiber…
megamoth
  • 695
  • 2
  • 12
  • 27
3
votes
2 answers

imagemagick in meteorjs (with the help of meteor-router and fibers)

I am unable to use imagemagick in meteorjs. I am working on a small svg->png converter which contains a rest api to provide the converted images. I implemented the rest api with meteor-router. The imagemagick convertion works. But, I am not able to…
David Graf
  • 1,152
  • 2
  • 13
  • 24
3
votes
1 answer

Are Node Fibers Blocking?

If you run an I/O intensive task in Node.js, like some async database operation, using node-fibers, is it blocking? I haven't used node-fibers yet b/c it seems that -- if used in code that processes an HTTP request in which some long…
Lance
  • 75,200
  • 93
  • 289
  • 503