Message from JavaScript discussions
September 2017
— And giving them control
Dispatcher.prototype.delegate = function () {
const timings = [];
var proc;
_delegate: for (var loc = 0; proc = this.queue[loc], !this.halt && loc < this.queue.length; loc++) {
if (proc === null) {
continue;
}
timings[loc] = process.hrtime();
var sysCall = proc.instance.next(proc.events);
timings[loc] = process.hrtime(timings[loc])
timings[loc][1] = proc;
proc.events.length = 0;
if (sysCall.done) {
this.queue[loc] = null;
}
if (sysCall.value !== undefined) {
this.sysCallHandler(sysCall.value);
}
}
return timings;
};
—
Dispatcher.prototype.run = function () {
if (!this.halt && this.procs.size > 0) {
this.running = true;
}
_cycle: while (!this.halt && this.procs.size > 0) {
this.scheduler.opt(this.delegate());
}
this.running = false;
};
— This is how the process delegation cycle takes place
— Why are you naming your loops :P
— I do out of habit haha
— Kek
— Your code is magic btw
— How so?
— Well, you really utilize the language tools, and you're fucking great at naming
— Like using the statements within the loops
— I suppose, is that rare?