Skip to main content
Stack Overflow for Teams is now Stack Internal: See how we’re powering the human intelligence layer of enterprise AI. Read more >
0 votes
1 answer
111 views

I'm looking to cancel an asynchronous function based on a signal that can be controlled by anything, similar to how a fetch can be aborted through the use of an AbortController - effectively ...
TheBrenny's user avatar
  • 545
0 votes
3 answers
145 views

I'm trying to understand the difference between the 2. If a CoroutineScope is not tied to any lifecycle-aware component, then I think they behave the same: If Im not passing any context to ...
Prexi's user avatar
  • 13
1 vote
0 answers
94 views

I'm working on a gRPC client that continuously streams data (such as images) from a server. I use a CancellationToken to stop the stream when needed. While cancellation works, I consistently see ...
Sumit Anand's user avatar
1 vote
0 answers
98 views

I have an asyncio function that spawns multiple tasks, any of which can return a result, in which case we want to shut down all the others. Right now, it does so in a matter something like the ...
Charles Duffy's user avatar
0 votes
1 answer
180 views

In my application I have a synchronous method that I am calling asynchronously by invoking Task.Run. I've noticed that the Task.Run call takes a cancellation token. However, in my tests I noticed that ...
FKus's user avatar
  • 41
3 votes
2 answers
205 views

Problem I'm working with asynchronous code in Rust and trying to handle user input from stdin in a cancel-safe manner. My goal is to be able to detect when a user presses a key (or hits enter) to ...
bitchwhocodes's user avatar
1 vote
1 answer
76 views

I want a C# console app that Runs multiple tasks Cancellable by Control C Unhandled exceptions in one task, cleanly cancel the other tasks. The below code deals with the cancellation correctly, but ...
Chris Davies's user avatar
3 votes
2 answers
128 views

The following code demonstrates that a long-running (but, in principle, cancellable) .Net method called from a job runs to completion even when the job is stopped: $stopwatch = [System.Diagnostics....
alx9r's user avatar
  • 4,343
0 votes
0 answers
107 views

I'm trying to implement a generic timeout for my requests in C#. I'm aware of the request timeout middleware, but it can't be instructed (as the middleware is handling the exception) to pass the ...
Sunib's user avatar
  • 352
0 votes
1 answer
87 views

I need to wait for replies for UDP broadcast with timeout, so I try ReadAsync with cancellation token and Threading.Timer to signal cancellation. There are two other computers, which reply to the ...
vss's user avatar
  • 21
1 vote
1 answer
105 views

I'm having trouble implementing the following properly: I have two IAsyncEnumerable instances (of the same type), one is the "primary" source, the purpose of the other is so the user can &...
Arokh's user avatar
  • 684
0 votes
1 answer
619 views

The HTML element <dialog> is intended to always be closed when you press Esc key according to documentation. The problem with that is that you might want it not to close immediately, i.e. if you ...
Nighto's user avatar
  • 4,262
2 votes
1 answer
126 views

I have the following method that waits for an event to happen to set the results by a TaskCompletionSource. private async Task<string?> RequestDataAsync(string? remoteEntity, CancellationToken ...
Arash's user avatar
  • 4,387
-1 votes
1 answer
77 views

My need is to upload a large file (several megabytes or even at least one gigabyte) and allow users to cancel the current upload request. Unfortunately, when i cancel the request via AbortController, ...
Brayce's user avatar
  • 1
0 votes
0 answers
77 views

I have an API to generate a long running task and a different API to fetch the result (can also be called to get a partial result). An example: [HttpGet] public IActionResult LongRunning() { var ...
FlamingDrake's user avatar

15 30 50 per page
1
2 3 4 5
50