w w w. l a m b d a 3 . c o m . b r
Async e Await
entenda e use agora!
Giovanni Bassi
• Programador
• MVP
• Não gerente
• Trouxe a Scrum.org, PSM e PSD pro Brasil
• blog.lambda3.com.br, podcast.lambda3.com.br,
dotnetarchitects.net, nodebr, dockersp
• @giovannibassi
• Escalador e ciclista
podcast.lambda3.com.br
0 – Eventos
1 – Docker
2 – .NET Core RC2
3 – Git
4 – Estudo
5 – Open Source
6 – Xamarin
7 – Node.js
8 – Democracia organizacional
9 – O programador poliglota
...
Toda semana em:
Callbacks
Promises com bibliotecas
(q, bluebird, etc)
Promises e Generators
Async/Await
EcmaScript 1
(ES1 - 1997)
2010
EcmaScript 2015 (ES6)
EcmaScript 2017 (ES8)
Function Expressions
EcmaScript 3
(ES3 - 1999)






function* fibonacci() {
let [fn1, fn2] = [0, 1];
while (true) {
yield fn1;
[fn1, fn2] = [fn2, fn2 + fn1];
}
}
for (const n of fibonacci()) {
if (n === 927372692193079200000) break;
process.stdout.write(`${n} `);
}














async function f1(){
await f3();
}


const f3 = async() => await f2;
const f2 = async function (){
await f1();
}






 tc39.github.io/ecma262/2017/#sec-async-function-definitions
 github.com/tc39/ecmascript-asyncawait
 github.com/giggio/asyncawaitsamples
w w w. l a m b d a 3 . c o m . b r
Dúvidas?
w w w. l a m b d a 3 . c o m . b r
Obrigado!

Async e await com JavaScript: entenda e use agora