3 ms·
Abusing notation a bit, var a = new Queue(); var b = new Queue(); a.read(() => some callback); b.read(() => some callback); And code continues here without
by moralestapia 5y ago
Abusing notation a bit,
var a = new Queue();
var b = new Queue();
a.read(() => some callback);
b.read(() => some callback);
And code continues here without blocking.
To be honest, I think you could do the same in any (slightly) modern language.
- paskozdilar 5y agoIs the read() call running a task in the background? In that case, that's equivalent to launching two threads. For n queues, you'd need n tasks, and they'd hang in the background in case they never get a result and take up memory.