4 ms·
Replace "expensive" with "this function can yield" and your argument becomes much stronger. The peer replies here are dinging you on the vagueness of "expensiv
by jayd16 2y ago
Replace "expensive" with "this function can yield" and your argument becomes much stronger.
The peer replies here are dinging you on the vagueness of "expensive" but it's not really about that. The explicit information given by async is whether a function will yield its execution context or retain control of it.
If you're leveraging "has control of the thread" as a form of concurrency (eg the UI thread) then knowing a function is sync or async is extremely important.