Aff and Promise event queues?

I have some questions about Aff.

V8 has an asynchronous completion queue. This is how JavaScript Promises are completed.

Aff has its own completion queue, by @natefaubion :

Why does Aff need its own completion queue? What do we get from that approach that we can’t get from just using the V8 queue, as in promises?

Having two async completion queues going in the same runtime strikes me as susceptible to starvation and strange race conditions? Do we have to attend to how they interact? Is aff-promise really as effortless as it looks, @nwolverson ?


I guess React also has its own asynchronous completion queue.

So using Aff in a React app, we have three asynchronous completion queues in the runtime, each scheduling work for the one OS thread. Does this work out well in practice? In my limited experience… yes, it seems fine?

1 Like

Maybe Aff needs its own async completion queue because JavaScript Promise.resolve() flattens nested promises?

1 Like