Questions tagged [async-await]
This covers the asynchronous programming model supported by various programming languages, using the async and await keywords.
337 questions
7
votes
1
answer
117
views
Proper cleanup in asyncio's __aexit__ in the case of cancellation
The following python code sample simulates an asyncio program which reads from a unix domain socket and prints its output (and additional debug output for later use)...
8
votes
2
answers
1k
views
C# wait for a state change without blocking
I have a class that manages an HttpClient to make API requests to a third party service. The service requires being logged in to make requests. When logged in, a ...
2
votes
1
answer
102
views
C# .NET 9 API for managing a personal investment portfolio
I've written a C# API using .NET 9 with the goal of managing a personal investment portfolio – that means,
adding funds
adding or removing transactions (for ETFs, ETCs, and usual funds)
retrieving ...
1
vote
0
answers
53
views
Async Rust UdpServer with Clean-Shutdown (using Tokio)
I'm new to Rust and trying to build an async Server.
The server should receive UDP packets, process them (which will include more network communication), and respond the result to the client.
I had ...
5
votes
2
answers
1k
views
An AsyncStreamWriter that allows to asynchronously write to a Stream
I'm hoping this should be mostly asynchronous, looking to make this close to 100%, if not 100%, so. This class was created to ease converting image formats, but it has an unlimited number of use cases....
5
votes
1
answer
114
views
Find food related words in German: Seeking Feedback on Concurrency and Code Organization
I'm developing a pipeline that processes unknown ingredient data from the OpenFoodFacts API. The goal is to find valid German words that are not yet in their taxonomy.
The tool performs the following ...
1
vote
2
answers
166
views
Scraper to grab publicly available data
I am using Python scraper code to grab publicly available data from http://XXXX.com, but it takes almost 6gb of memory and more cpu. I need to run multiple ...
2
votes
1
answer
159
views
Simple priority task scheduler implementation
My project I am working on requires the following functionality for the processed messages:
each message has a priority
messages with higher priorities should have precedence over the ones with lower ...
2
votes
1
answer
229
views
Proving that a Window Message is being sent by async/await
I asked a question on Stack Overflow and there's a discussion between @Serg, who posted an answer and @Jimi, whose comments suggest that the answer might be wrong.
So I implemented the following code ...
6
votes
1
answer
3k
views
C# Async FileInfo Extensions (Copy, Move, Delete)
Here is my effort to implement extensions for FileInfo object:
...
1
vote
1
answer
3k
views
Process a binary file by chunk using a read stream in nodejs
I want to process a file chunk by chunk to prevent memory exhaustion. I need to consume the file using a read stream. When trying it, this implementation seems to work fine.
I am asking your expert ...
3
votes
2
answers
2k
views
Extension methods to modify an async Task's type from Task<IEnumerable<T>> to Task<List<T>>
I've written a lot of (await SomeTask).AsList(); in my project, and it's kind of annoying to keep wrapping it.
To fix this I've written a little extension method on ...
10
votes
4
answers
10k
views
AsyncDictionary - Can you break thread safety?
This class is an Async/Await wrapped Dictionary. Of course it doesn't technically implement IDictionary, but the functionality is basically the same as an IDictionary. It achieves similar ...
14
votes
2
answers
47k
views
Using async / await with dynamic import() for ES6 modules
I am experimenting with the best way to standardise my dynamic import() expressions when importing javascript modules.
import() ...
11
votes
3
answers
788
views
Asynchronously scrape fabric information
This is my first asyncio/aiohttp web scraper. I am trying to wrap my head around Python's asyncio/aiohttp libs these days and I am not sure if I fully understand it or not yet. So I'd like have some ...