cancellation Questions

2

Solved

The docs for cancel make it sound like you should usually propagate CancelledError exceptions: Therefore, unlike Future.cancel(), Task.cancel() does not guarantee that the Task will be cancelled, ...

11

Solved

All four functions are called below in update return promises. async function update() { var urls = await getCdnUrls(); var metadata = await fetchMetaData(urls); var content = await fetchContent...

14

Solved

I use ES6 Promises to manage all of my network data retrieval and there are some situations where I need to force cancel them. Basically the scenario is such that I have a type-ahead search on the...
Gangrel asked 14/5, 2015 at 9:3

7

The Abortcontroller signal is not working for me with Axios in React. I wanted to replace CancelToken (as it's deprecated) with the AbortController, but it is not working, respectively the requests...

2

I want to make a copy of a context object - a request context to be exact, and make use of it later on in a separate go routine. Problem is if I derive the request context using context.WithCancel...
Ohmmeter asked 15/12, 2019 at 22:42

4

Solved

I am using an external library that has async methods, but not CancellationToken overloads. Now currently I am using an extension method from another StackOverflow question to add a CancellationTo...
Misbehavior asked 14/6, 2017 at 9:5

6

When a TCP connection gets cancelled by the client while making a HTTP request, I'd like to stop doing any work on the server and return an empty response. What HTTP status code should such a respo...
Dyspnea asked 15/9, 2017 at 8:3

2

I'm trying to wrap the SerialPort's read method in a task that can be awaited, that way I can get the benefits of using a CancellationToken and the timeout from the SerialPort object. My issue is t...
Hajj asked 8/12, 2017 at 21:24

3

Solved

I want to cancel a promise in my React application using the AbortController and unfortunately the abort event is not recognized so that I cannot react to it. My setup looks like this: WrapperCompo...
Scad asked 1/12, 2021 at 16:7

2

Solved

In order to prevent phantom updates to an unmounted React component, React tells you to cancel any pending promises on a component (such as promises for fetching additional data) when it unmounts. ...
Blackbeard asked 2/1, 2020 at 18:43

3

So I need to stop a running Job in Sidekiq (3.1.2) programmatically, not a scheduled one. I did read the API documentation but didn't really find anything about cancelling running jobs. Is this pos...
Hamblin asked 17/9, 2014 at 11:45

3

Solved

How can I create a copy (a clone if you will) of a Go context that contains all of the values stored in the original, but does not get canceled when the original does? It does seem like a valid us...
Ranunculaceous asked 10/1, 2019 at 12:33

2

Solved

I'm confused how std::jthread::get_stop_token is designed to work, because it seems to have an inherent race condition. Namely, the executing thread can't simply call std::jthread on itself (as in ...
Donovan asked 22/4, 2021 at 8:5

3

Solved

I am currently playing around with Grand Central Dispatch and discovered a class called DispatchWorkItem. The documentation seems a little incomplete so I am not sure about using it the right way. ...

3

Solved

In case one task of gather raises an exception, the others are still allowed to continue. Well, that's not exactly what I need. I want to distinguish between errors that are fatal and need to cance...
Assyrian asked 27/11, 2019 at 15:29

3

I am uploading an image with HttpClient.PostAsync() on my Windows Phone 8 app. The user has the option to cancel this upload via a UI button. To cancel the POST request, I set a CancellationToken....
Beiderbecke asked 17/7, 2015 at 8:20

2

Solved

I need to support cancellation of a function that returns an object that can be cancelled after initiation. In my case, the requester class is in a 3rd party library that I can't modify. actor MyAc...
Jutta asked 16/4, 2022 at 23:1

2

How to reject a delayed Promise: const removeDelay = Promise.delay(5000).then(() => { removeSomething(); }); //Undo event - if it is invoked before 5000 ms, then undo deleting removeDelay.rej...
Prerecord asked 30/9, 2015 at 17:24

4

I am using agora io for video calling and screen sharing. screen share is working fine. But problem is when I cancel the screen share then stream is not displaying. But join is still active. I need...
Unfreeze asked 24/9, 2019 at 2:49

2

Solved

In C#, I am interested in stopping a Parallel.ForEachAsync loop (considering the differences between Stop and Break); for Parallel.ForEach I can do the following: Parallel.ForEach(items, (item, sta...

5

Solved

I have a data gathering component which includes 'cancel' button to cancel the whole process. The problem is, if some of the HTML input fields which are validated by Angular 2 validators have focus...
Canescent asked 10/7, 2017 at 14:58

2

Solved

I was experimenting with how to break out of a ForEachAsync loop. break doesn't work, but I can call Cancel on the CancellationTokenSource. The signature for ForEachAsync has two tokens - one as a ...
Yardman asked 1/12, 2021 at 21:15

1

There has been other topics on SE, but most of them are dated 5 years ago. What is the current, up-to-date approach to cancel await call in JS? i.e. async myFunc(){ let response = await oneHourLas...
Boatload asked 23/11, 2021 at 12:30

2

Solved

In our project, we have decided to provide a cancellation mechanism for users with the help of CancellationToken. Because of the structure of the works in the project, I need a hierarchical cancell...
Nowt asked 10/10, 2021 at 15:5

2

I see microsoft enforces this pattern for async methods: async Task<object> DoMyOperationAsync(int par1, string par2,..., CancellationToken token=default(CancellationToken)) { ... Cancella...
Occident asked 5/8, 2019 at 21:41

© 2022 - 2024 — McMap. All rights reserved.