You are reading content from Scuttlebutt
@mikey
Voted oh in case people don't know a lot of the async around scuttlebutt gets han
@mikey
Voted [@radmen](@4eH+xnoJ2Mc5KTjjt66dKARijwExUUdCRDfHa2XjOxw=.ed25519) Hmm, paral
@radmen
Voted [@radmen](@4eH+xnoJ2Mc5KTjjt66dKARijwExUUdCRDfHa2XjOxw=.ed25519) Hmm, paral
@radmen
Re: %F9kbzxfpT

@Martin Heidegger yes, you're right about this one.

@Martin Heidegger
Re: %F9kbzxfpT

@radmen Hmm, parallel operations make quite some differences when doing file access, running tcp requests or other db requests. Assuming that serial is fast enough is a treacherous assumption for slower networks/hardware, particularly when your system is a fast one.

@radmen
Re: %F9kbzxfpT

@Martin Heidegger you wanted to say that it is serial rather than parallel? :smiley:

You are completely right.

Tbh, sometimes there's no significant gain from making parallel calls. JS is still single threaded which means that Promises are not taking any benefits from multi-threaded architecture. They just try to optimize CPU usage.

@Martin Heidegger
Re: %F9kbzxfpT

@radmen The Promise version of yours is parallel then serial, your async version does all three things in series.

@radmen
Re: %X+N01AsSY

sure, you can do it this way :smiley:

@mix
Re: %F9kbzxfpT

oh in case people don't know a lot of the async around scuttlebutt gets handles by pull-stream

@Martin Heidegger
Re: %F9kbzxfpT

@radmen quickly pointing out a difference and then hiding behind a stone:

const [ resultA, resultB ] = await Promise.all([doSomethingForA(), doSomethingForB()])
const resultC = await doSomethingForC()

doSomethingHere(resultA, resultB, resultC)

Show whole feed
Join Scuttlebutt now