27,810 questions
Advice
1
vote
10
replies
97
views
Prevent Winforms function from returning until Async calls have completed (without blocking)
I have a handler for AppDomain.CurrentDomain.UnhandledException that uses Async calls to write an error log file. Unfortunately, it returns to the source of the exception (which then shows the ...
-2
votes
0
answers
61
views
Need a scheduling callback/hook for async state machine continuation in .NET profiler [closed]
I am developing a .NET CLR profiler using the Profiling API (ICorProfilerCallback) and trying to track async thread switches caused by await.
For Task.Run(), I can correlate scheduling and execution ...
Best practices
1
vote
5
replies
136
views
How can fix this problem from json placeholder? ullrich
Why is Promise.all() faster than sequential await calls?
Question
I have two versions of a function.
I understand that Promise.all() runs both requests in parallel, but I would like to know:
how ...
Advice
2
votes
7
replies
119
views
Pool multiple events and await the first one in C++
If I had multiple sockets to wait for information from, on a POSIX system I would use poll on multiple pollfd for POLLIN roughly as follows...
struct pollfd pollFds[2] = {};
pollFd[0].fd = socket_0;
...
Best practices
1
vote
2
replies
79
views
How to yield a reference to internally pinned data in a custom Stream implementation? (Lifetime mismatch with GATs)?
I am building a high-performance asynchronous zero copy parser in Rust. My goal is to read byte blocks from the underlying asynchronous reader into an internal buffer, parse them, and then generate ...
Best practices
0
votes
0
replies
68
views
waiting for asyncio.Task completion, propagate exceptions
For asyncio workloads there's this convenience function that executes passed list of asyncio.Tasks until either
a timeout is hit;
first Task raises an exception; or
all tasks succeed
First two ...
0
votes
0
answers
98
views
AWSSDK .Net GetObjectAsync hung
I'm trying to interact with a custom S3 storage, but part of methods in AmazonS3Client hangs off. I found several posts with similar problems, but they didn't help me.
Initially, I declared s3Client ...
Best practices
0
votes
5
replies
126
views
Should I use async to ensure data is returned from db call
I have this function called BulkCopyIntoTable which filters a datatable and based off the max integer of the table im inserting into and inserts data that is greater than that integer. I use the ...
Best practices
2
votes
17
replies
341
views
When to stop using await
If every async method I need to return a Task and use await. Then I propagate the await to the caller, then all invoking methods have to be Async and use await?
So if I have a method:
async Task<...
Best practices
0
votes
4
replies
94
views
How to adhere to abstraction and asynchrony
public async Task<IEnumerable<Patient>> GetWaitingPatientsAsync()
{
return await _context.Patients.AsNoTracking().Where(x => x.Status == PatientStatus.Waiting).ToListAsync();
}
I ...
Best practices
0
votes
0
replies
62
views
Testing Aiogram with pytests and database and redis
I want to test my aiogram bot using pytest. I have sqlalchemy orm and redis and I want to test my async handlers, but the problam that i don't know how to get message and other handler's dependencies (...
Advice
0
votes
0
replies
158
views
writing NUMA aware high performance programs in rust
It's interesting I didn't find anything specifically for this topic while browsing around. I would like to write a high performance application in rust and I'm wondering:
What is the most performant ...
0
votes
1
answer
188
views
Propagate errors across task boundaries in an ergonomic way
I am writing a small cli application to learn rust and did start my error propagation with a lot of Result<_, Box<dyn std::error::Error>>. This is quite flexible and works nicely.
Now I ...
Best practices
2
votes
10
replies
254
views
Should I await a single line "pass through" method?
Consider the following call chain:
public class MainClass
{
// Lets say this is called from a front-end button click.
public async SomeButtonClick()
{
await OtherClass....
6
votes
0
answers
176
views
Code coverage reports uncovered branch on method returning IAsyncEnumerable<T> [closed]
I have the following function, which is basically a wrapper around something that makes a SQL call and reshapes the results:
public async IAsyncEnumerable<T> ExecuteTable<T>(string sql, ...
