About 7,230,000 results
Open links in new tab
  1. c# - How and when to use ‘async’ and ‘await’ - Stack Overflow

    Jan 22, 2013 · From my understanding one of the main things that async and await do is to make code easy to write and read - but is using them equal to spawning background threads to …

  2. Using async/await with a forEach loop - Stack Overflow

    Are there any issues with using async/await in a forEach loop? I'm trying to loop through an array of files and await on the contents of each file. import fs from 'fs-promise' async function print...

  3. When correctly use Task.Run and when just async-await

    AFAIK you don't gain anything by adding a second await and async inside Task.Run. And since you aren't passing parameters, that simplifies slightly more to await Task.Run( …

  4. How to cancel a Task in await? - Stack Overflow

    await client.CancelAsync(); throw; } } Note that this will not stop the Task you were waiting for and it will continue running. You'll need to use a different mechanism to stop it, such as the …

  5. async/await - when to return a Task vs void? - Stack Overflow

    If there's no reason to disallow having the caller await your task, why disallow it? async methods that return void are special in another aspect: they represent top-level async operations, and …

  6. How to set class attribute with await in __init__ - Stack Overflow

    Oct 14, 2015 · How can I define a class with await in the constructor or class body? For example what I want: import asyncio # some code class Foo(object): async def __init__(self, settings): …

  7. Understanding async / await in C# - Stack Overflow

    I'm starting to learn about async / await in C# 5.0, and I don't understand it at all. I don't understand how it can be used for parallelism. I've tried the following very basic program: …

  8. Call async/await functions in parallel - Stack Overflow

    await someCall(); await anotherCall(); Do I understand it correctly that anotherCall() will be called only when someCall() is completed? What is the most elegant way of calling them in parallel? I …

  9. c# - What should I use as a dummy awaitable? - Stack Overflow

    Mar 4, 2015 · It's just a signal to the compiler that it's allowed to use the identifier await as a keyword, basically - to maintain backwards compatibility with older C# code.

  10. Proper way to wait for one function to finish before continuing?

    Feb 3, 2014 · 89 An elegant way to wait for one function to complete first is to use Promises with async/await function.