These are 2 different ideas about generating output in an async manner for generators.
I may be misunderstanding the problem though.
function* mappedIterator() {
var arr = [1,1,2,3];
var results = [];
// | |
// This assumes the runner supports | |
// - generators (for a transpiler see http://facebook.github.io/regenerator/) | |
// - Promises (for a polyfill see https://github.com/petkaantonov/bluebird) | |
// | |
// This does not need outside libraries to be loaded | |
// | |
// This survives direct eval semantics, unless you use regenerator, in which case the unwinding will cause variable renaming | |
// |
// spawn() taken unmodified from https://gist.github.com/Benvie/8327917 | |
// See http://taskjs.org for the original. | |
function spawn(thunk) { | |
return new Promise(function(resolve, reject) { | |
var gen = thunk(); | |
function _next(v) { | |
return handle(gen.next(v)); | |
} | |
# | |
# Still a lot to do, but it works! | |
# Been looking at how to do this for a long time | |
# | |
# Todo: good quality ecryption | |
# Todo: in memory resources (right now it is self extracting) | |
# Todo: check windows, should work but probably needs some tweaking |
// | |
// Code to update bootstrap | |
// | |
var fs = require('fs'); | |
var path = require('path'); | |
var zlib = require('zlib'); | |
var MAX_COMMENT_SIZE = 65535; | |
var CENTRAL_DIRECTORY_HEADER_SIZE = 22; |
// | |
// # flatter.js | |
// | |
// ## usage | |
// | |
// run `node flatter.js` in a node module directory | |
// | |
// generates commands to flatten a nested directory structure using symlinks | |
// flattened directories become named `node_modules/f~{{id}}` | |
// this does not run the commands, it merely prints them |
env NAME=taco_service_1_Worker | |
env DESC= | |
env NODE_ENV=development | |
export NODE_ENV | |
env PORT=1032 | |
export PORT | |
start on runlevel [2345] | |
stop on runlevel [!2345] |
;(function () { | |
// random is ... less random | |
var _random = Math.random.bind(Math); | |
Math.random = function random() { | |
return _random() / 1; | |
} | |
// setInterval becomes nested setTimeout | |
var _setTimeout = setTimeout; |
module['exports'] = function echoHttp (hook) { | |
hook.debug(hook.params); | |
hook.debug(hook.req.path); | |
hook.debug(hook.req.method); | |
hook.req.pipe(hook.res); |
Async Stack Traces in Chromium: | |
=== | |
These are only turned on once the debugger starts up due to performance hits! | |
Implementing this requires the ability to integrate with V8 on a C++ level or a suitable debugging agent for the V8 debug APIs | |
### Setup |