Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Show HN: Nsynjs – JS engine with stoppable threads and without callback hell.
var Fiber = require('fibers'); function sleep(ms) { var fiber = Fiber.current; setTimeout(function() { fiber.run(); }, ms); Fiber.yield(); } Fiber(function() { console.log('wait... ' + new Date); sleep(1000); console.log('ok... ' + new Date); }).run(); console.log('back in main');
1: https://github.com/laverdet/node-fibers 2: https://github.com/meteor/meteor
There are no comments on this comment yet.
1: https://github.com/laverdet/node-fibers 2: https://github.com/meteor/meteor