Questions tagged [cancellation]

Cancellation is paradigm that allows cooperatively canceling a running operation before it finishes.

Cancellation is paradigm that allows cooperatively canceling a running operation before it finishes.

In , cancellation is achieved using for signaling cancellation and a CancellationToken is used by the operation to check whether cancellation was requested.

712 questions
0
votes
1 answer

PayPal Subscription Cancellation from Merchant Website

we have a paypal payment system integrated into our website so people can register and choose a subscription. The subscription part works fine as the payment goes through and the IPN hits our website and updates our systems. Now we want users to be…
0
votes
0 answers

Cancellation of a long running task in C#

I am working on a project where we have lots of separate components are running and my agenda is to cancel the component process in between based on user input. For example: I have 6 windows service that do all the work and 1 another windows service…
Abhash786
  • 881
  • 2
  • 24
  • 53
0
votes
2 answers

C# How to stop running backgroundWorker without cancellationPending

is there any way to stop backgroundWorker thread without cancellationPending? I have code like this: DoWorkFunction { if(worker.cancellationPending == true) return; //this works great but VeryLongTimeComputingFunc();//this function…
0
votes
1 answer

How to properly cancel a BackgroundWorker

I've got a GUI form which is acting as the main thread, while I've got a different class for the actual work which is needed to be done. Is there a way to properly check the CancellationPending property of the worker since it's being activated from…
CodeMonkey
  • 11,196
  • 30
  • 112
  • 203
0
votes
3 answers

How to poll from worker thread for cancellation

I have a UI which spawns off a background worker thread which performs a complex tree of tasks and sub-tasks that takes about a minute to complete. A requirement is that the background worker task must be capable of being cancelled once it has…
Weyland Yutani
  • 4,682
  • 1
  • 22
  • 28
0
votes
1 answer

ContentProvider: How to cancel a previous call to delete()?

I'm using a custom ContentProvider. For querying, there is a CancellationSignal (API 16+) which can be used to cancel a previous call to query(). My question: How can I archive that with delete()? For clarification, my custom provider manages files…
user1521536
0
votes
2 answers

Async Repository & CancellationToken

We're moving to .NET 4.5 and I'm considering adding async to my repositories: interface IRepository { T Find(int id); Task FindAsync(int id); IEnumerable FindAll(); Task> FindAllAsync(); …
n8wrl
  • 19,439
  • 4
  • 63
  • 103
0
votes
1 answer

Canceling background task during WPF XBAP application exit

I have a wpf xbap application that downloads some data in background. There is a need to stop downloading and flush cache on application exit. Now it is implemented as follows : App.xaml : App.xaml.cs : private…
Jaded
  • 1,802
  • 6
  • 25
  • 38
0
votes
1 answer

Rails Cancel Confirmation Reason

I have an application, which contains calls. I want to be able to cancel the call and supply a reason for the call cancellation. So far I have my cancel action working in the controller, but I'm trying to figure out how to expand it so before it…
nulltek
  • 3,247
  • 9
  • 44
  • 94
0
votes
1 answer

Linux POSIX in C program fail in cancellation threads

I'm writing a program which reads portions of data in different threads then finds a pattern within them. But before that (the problem occurs in code below) I just wanted to check whether threads cancel properly. That's where I'm stuck. It takes…
aragornsql
  • 121
  • 1
  • 6
-1
votes
1 answer

How to dispose a LongRunningTask using cancellationTokens

Related to this question: I need to cancel long running loop in signalR, how do i do this? I set up a quick way to better understand the situation for myself and found Half a solution. I'm able to cancel a task (not sure how since the…
-1
votes
1 answer

Stop a recursive function which uses setTimeout

I have the following template in my project: function sleep (ms) { return new Promise(resolve => setTimeout(resolve, ms)); } async function foo (x) { await sleep(3000) await asyncTask() await foo() } It should repeat the job (foo) until a…
VIVID
  • 555
  • 6
  • 14
-1
votes
1 answer

Polly Timeout policy wrapped in WaitAndRetry policy does not work

I have a service which writes files over some network using FileStream, without a write timeout. I added a Polly WaitAndRetry policy to handle occasional write failures, and that works great. I noticed that sometimes a write just hangs though, so…
Dondey
  • 267
  • 4
  • 13
-1
votes
1 answer

How do I cancel an edit in the Silverlight DataGrid when a validation error has occurred?

I have DataGrid and during a cell edit, a validation error occurs (my binding throws an exception and the error is correctly displayed to the user). The user then chooses to just click somewhere (either to navigate to a different portion of my…
Jeff Yates
  • 61,417
  • 20
  • 137
  • 189
-1
votes
1 answer

UIActivityViewController handle Cancel action | Swift/Xcode

I can't find complete code in Swift of how to execute an action when the user presses the "x" in a UIActivityViewController (top right), cancelling the share. This is what I currently have: do { try pdfData.write(to:…