run0 static method
Implementation
static Object run0(
int index, List<Function> fns, Socket socket, Function fn) {
return fns[index](socket, (err) {
// upon error, short-circuit
if (err) return fn(err);
// if no middleware left, summon callback
if (fns.length <= index + 1) return fn(null);
// go on to next
return run0(index + 1, fns, socket, fn);
});
}