4 ms·
Or you can have a language where the implied `await` is delayed until the information is used, but the initiation starts as soon as the information required to
by jlokier 5y ago
Or you can have a language where the implied `await` is delayed until the information is used, but the initiation starts as soon as the information required to initiate is ready:
asset1 = httpGET(...)
asset2 = httpGET(...)
doSomethingWith(asset1)
doSomethingWith(asset2)
No problem, both requests concurrent, don't have to think about it. They will probably be neatly batched by the executor into a single outgoing TCP packet too.
asset1 = httpGET(...)
asset2 = httpGET(functionOf(asset1))
doSomethingWith(asset2)
Second request has to wait until the first has completed, because this is correct. It can't be started until the first is completed.