Questions tagged [async-await]

This covers the asynchronous programming model supported by various programming languages, using the async and await keywords.

Filter by
Sorted by
Tagged with
5
votes
0answers
133 views

Scheduler built with observables v2 (follow-up)

It would probably be too easy if the old Scheduler worked as intended being that simple. But an eye-openig review showed that from time to time it'll miss one ...
4
votes
0answers
98 views

Toggle any application feature ON or OFF

When testing or debugging applications it'd be often useful to be able to run it without certain features like committing things to the database, saving files, sending emails, reading files, executing ...
4
votes
1answer
3k views

Concurrent/parallel ForEachAsync - proper handling of exceptions and cancellations

I've created an asynchronous parallel ForEach mechanism so I could enumerate an enumerable by N degrees of concurrency and process an action for each item. ...
3
votes
1answer
2k views

Creating a concurrent/parallel ForEachAsync that can fail immediately or wait until enumeration is complete

I needed an asynchronous parallel ForEach mechanism so I could enumerate an enumerable by N degrees of concurrency and process an action for each item. Searching ...
6
votes
2answers
9k views

Async and error-handling

I need to delete a file when an error occurs during loading it. It is not allowed to perform async operations in a catch block. This has lead me to writing the following code: ...
8
votes
1answer
1k views

Async Yield and continue on TaskPool

Using await task.ConfigureAwait(false) is a standard best practice for indicating to the compiler that the continuation does not need to be run on the current ...
5
votes
1answer
105 views

Scheduling using System.IObservable 2.0

As a follow up to this first attempt to create and use my own IObservable<T> implementation, this is version 2.0. The goal has been to correct the code where ...
4
votes
3answers
11k views

Simple SqlHelper which wraps ADO.NET methods

I am creating a simple SqlHelper which will simplify the ADO.NET method usage. Can someone please review this class for any issue or missing something? ...
2
votes
0answers
71 views

Scheduler built with observables v3 (follow-up) - now testable

This is a 2nd follow-up to my previous one about a Scheduler built with observables. Although the last one was working correctly, it was only possible to see this ...
2
votes
0answers
123 views

Multithreaded download of images from a spreadsheet

I've been wanting to go async with my HTTP calls but all the methods I tried have not worked, so I resolved to implement this as a task and then improve upon it. This is what I've come up with so far....
21
votes
2answers
305 views

RubberduckParser 2.0 - Asynchronous Parsing

The IRubberduckParser interface has seen breaking changes, and now looks like this: ...
5
votes
1answer
150 views

Verifying that tasks are really async with AsyncDetector

Running tasks asynchronously can sometimes by tricky and no matter how careful I am, I sometimes forget some crucial part and my tasks run synchronously. I don't usually notice that until it's too ...
4
votes
1answer
114 views

Scheduling using System.IObservable

With great inspiration from t3chb0ts ongoing work about scheduling, cron jobs etc. (last post here), I decided to make my own version of the Scheduler - using the observer pattern - as a learning ...
4
votes
2answers
179 views

IsoStorageManager

A manager for a speedy async saving objects to isolated storage, using serialization from Newtonsoft.Json. A project to play with is here. ...
3
votes
1answer
3k views

Running async tasks and cancelling after a timeout if necessary

I have a few tools that run automatically. In those tools I usually run two to six jobs that run asynchronically. Sometimes when there is more data then expected or to prevent them from running ...
3
votes
1answer
330 views

Recursively find TypeScript files imported/exported from an entry point

I'd like to know what's the best practice as functional programming in JavaScript to work with arrays and passing them as an argument to a recursive function that may run itself within its branch. In ...
3
votes
1answer
4k views

Downloading data using HttpClient

I'm working on a class to download some data from an external server and feed it into my data model. I'm new to both HttpClient and ...
3
votes
0answers
338 views

Blocking Promise-driven queues with ECMAScript's async/await and generators

I implemented an AsyncQueue, whose dequeue() operation returns a Promise. The ...
2
votes
1answer
864 views

Ensuring no race conditions in my concurrent/parallel ForEachAsync method

Hopefully the final chapter of my ForEachAsync code review. The original question was the starting point and the second question contained modifications suggested ...
1
vote
1answer
181 views

Change implementation from getting json from file to get it from API

I used to get a JSON file with some configuration settings from the file system, using this class: ...
1
vote
1answer
160 views

ThreadSafe IsoStorageManager

This is a continuation of the last thread. I wanted to add a thread-safety and I was considering AwaitableCriticalSection and Task+Mutex. I ended up with mutex; it can be a bit slower but it would ...