Aprenda Go 🇧🇷 Cap. 21 – Canais – 8. Context
Cap. 21 – Canais – 8. Context Transcript and Lesson Notes
- Só pra ter uma idéia geral: - Se a gente lança 500 goroutines pra fazer uma tarefa, e cancelamos a tarefa no meio do caminho, como fazemos pra matar as goroutines? - Documentação: https://golang.org/pkg/context/ - Aos
Quick Summary
- Só pra ter uma idéia geral: - Se a gente lança 500 goroutines pra fazer uma tarefa, e cancelamos a tarefa no meio do caminho, como fazemos pra matar as goroutines? - Documentação: https://golang.org/pkg/context/ - Aos
Key Takeaways
- Review the core idea: - Só pra ter uma idéia geral: - Se a gente lança 500 goroutines pra fazer uma tarefa, e cancelamos a tarefa no meio do caminho, como fazemos pra matar as goroutines? - Documentação: https://golang.org/pkg/context/ - Aos
- Understand how golang fits into Cap. 21 – Canais – 8. Context.
- Understand how programar fits into Cap. 21 – Canais – 8. Context.
- Understand how go fits into Cap. 21 – Canais – 8. Context.
- Understand how programacao fits into Cap. 21 – Canais – 8. Context.
Key Concepts
Full Transcript
- Só pra ter uma idéia geral: - Se a gente lança 500 goroutines pra fazer uma tarefa, e cancelamos a tarefa no meio do caminho, como fazemos pra matar as goroutines? - Documentação: https://golang.org/pkg/context/ - Aos aventureiros: https://blog.golang.org/context - Destaques: - ctx := context.Background - ctx, cancel = context.WithCancel(context.Background) - goroutine: select case ←ctx.Done(): return; default: continua trabalhando. - check ctx.Err(); - Tambem tem WithDeadline/Timeout - Exemplos (Todd): - Analisando: - Background: https://play.golang.org/p/cByXyrxXUf - WithCancel: https://play.golang.org/p/XOknf0aSpx - Função Cancel: https://play.golang.org/p/UzQxxhn_fm - Exemplos práticos: - func WithCancel: https://play.golang.org/p/Lmbyn7bO7e - func WithCancel: https://play.golang.org/p/wvGmvMzIMW - func WithDeadline: https://play.golang.org/p/Q6mVdQqYTt - func WithTimeout: https://play.golang.org/p/OuES9sP_yX - func WithValue: https://play.golang.org/p/8JDCGk1K4P
Lesson FAQs
What is Cap. 21 – Canais – 8. Context about?
- Só pra ter uma idéia geral: - Se a gente lança 500 goroutines pra fazer uma tarefa, e cancelamos a tarefa no meio do caminho, como fazemos pra matar as goroutines? - Documentação: https://golang.org/pkg/context/ - Aos
What key concepts are covered in this lesson?
The lesson covers golang, programar, go, programacao, programação.
What should I learn before Cap. 21 – Canais – 8. Context?
Review the previous lessons in Aprenda Go 🇧🇷, then use the transcript and key concepts on this page to fill any gaps.
How can I practice after this lesson?
Practice by applying the main concepts: golang, programar, go, programacao.
Does this lesson include a transcript?
Yes. The full transcript is visible on this page in indexable HTML sections.
Is this lesson free?
Yes. CourseHive lessons and courses are available to learn online for free.
