I would like to know which is the best solution when using asynchronous programming. Which one should I use?
1 Answer 1
Always use async/await for asynchronous tasks.
Yield should only be used for generator functions. Read this article on when and how to use (it's worth the time).
answered Dec 17, 2018 at 14:57
sandrooco
8,8861111 gold badges5656 silver badges101101 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
Explore related questions
See similar questions with these tags.
- The Overflow Blog
-
- Featured on Meta
-
-
Related
Hot Network Questions
- Define Min and Max Values in Geometry Nodes Relatively to Another Mesh
- Undecidable Checkmate
- What literature can I read about the Janibekov effect and the intermediate axis theorem?
- Urgent clarification on transit and Schengen visa requirement at Milan Malpensa Airport (MXP)
- What should I do if my foreshadowing was too obvious and readers picked up on it immediately?
- Adding math kerns (aka cut-ins or staircase kerning) to OpenType math fonts
- If I rank duplicate weapons or frames up to 30, do they all count towards Mastery Rank?
- Find the nearest school to you
- What’s the Helminth?
- Include endowed chairs/emeritus status in recommender titles for grad apps?
- Full-bridge rectifier causes strange slow oscillation of the DC voltage envelope
- Dummy variable rule for indefinite integrals?
- Can concepts in Devarim be used equally to interpret concepts in the other books?
- Does bread improver and vital wheat gluten affect water absorbency in wholemeal bread?
- What does E.T. mean in E.T. the Extra-Terrestrial?
- Are there catholic writings of popes or bishops that mention Anne the mother of Saint Mary before the condemnation of Protoevangelium of James?
- Low-Side Current Sense Simulation
- Did around 50% of sailors die from scurvy on long voyages?
- When (if ever) did common people address each other as "comrade" in China and Russia/the Soviet Union?
- Can I backup Legends Arceus save file to use, in case I want to format my Switch?
- Does spectroscopy count as a measurement of electron spin?
- The difference between /ɪ/ and /ə/ on unstressed syllable
- Expected number of upsets in a knockout tournament
- Formal and intuitive definitions of nilpotent group
lang-js
yieldfor asynchronous programming with promises, they are totally outdated.