Questions tagged [request-cancelling]

Stopping or safely ignoring a request, usually an HTTP transaction between a client and a server.

Stopping or safely ignoring a request, usually an HTTP transaction (GET, POST, etc.) between a client and a server.

This is most often applicable in an AJAX context -- especially if synchronous AJAX is used.

Requests can be canceled/ignored by the client and/or the server.

71 questions
3
votes
1 answer

Axios cancel token cancelling every request

I' trying to implement cancelToken API so that whenever i'm making a request to server to fetch results on every key stroke, only the last request should get processed, however i have implemented the axios cancel token API and it seems to cancel…
3
votes
4 answers

Java Threads: Shutdown flag vs Catching Exception

In threads when dealing with cancelation, you often you see code like this while (!shutdown) { .. do something, if a blocking call, then it will throw the interrupted exception try { .. some more ... } catch (InterruptedException e) { …
sksamuel
  • 16,154
  • 8
  • 60
  • 108
3
votes
0 answers

How to cancel request in Http Interceptor in angular5?

My angular app have a component called 'listdata.component.ts'.In ngOnInit() of this component there happens 2 api calls. But when 401 response got for the 2 requests a logout api call takes place 2 times. My interceptor code @Injectable() export…
3
votes
2 answers

canceled status blocking font download

I have a page with some text that has been given a font-family of constitution: This font was downloaded from a foundary and is defined for the page with an @font-face: When the page renders, the browser goes out for the font but the request is…
Steve
  • 4,534
  • 9
  • 52
  • 110
3
votes
1 answer

iPhone - cancelPerformSelectorWithTarget not working

If I do this in a subclass of UIView: [self performSelector:@selector(doSomething) withObject:nil afterDelay:5]; Then cancel it like this (I've tried both versions): [[NSRunLoop currentRunLoop] cancelPerformSelectorsWithTarget:self]; …
sol
  • 6,402
  • 13
  • 47
  • 57
3
votes
1 answer

How to detect if HttpClient.CancelPendingRequests was used to cancel pending requests?

Application Setup I am using HttpClient to make mulitple Async POST requests to a REST service from a Windows Forms Application. Meanwhile the response is fetched from the REST service the application shows a Processing... window with a Cancel…
2
votes
1 answer

AddScoped dependency with a CancellationToke

I have a .NET core dependency that is scoped to each REST API request. It is added in Startup.ConfigureServices with a call to AddScoped. I want to add cancellation support to this. If I add a CancellationToken cancellationToken to any controller…
Keith
  • 150,284
  • 78
  • 298
  • 434
2
votes
1 answer

How to cancel a running AXIS 1.4 SOAP request?

Is it possible to cancel a SOAP request (Axis 1.4, Java 1.6) that's currently executing? I'm using the interfaces generated with WSDL2Java, so the call is something like myProvider.submitMyRequest(request). This is synchronous and doesn't return…
tro
  • 524
  • 4
  • 12
2
votes
1 answer

Canceling BackgroundWorker within the Thread

I have a longer running multi-step process using BackgroundWorker and C#. I need to be sure that each step is completed successfully before moving on to the next step. I have seen many references to letting the BackgroundWorker catch errors and…
Mike Wills
  • 20,959
  • 28
  • 93
  • 149
2
votes
1 answer

Does SOAP support canceling a call?

When using the SOAP protocol, is it possible to cancel a pending remote function call using SOAP? I see three different situations: A) Making a request to a service that takes a long time to complete. For example, when copying directory containing…
Dimitri C.
  • 21,861
  • 21
  • 85
  • 101
2
votes
0 answers

How do I abort or stop an http request in NodeJs

While NodeJs architecture does very well to process server requests in a non-blocking way, it is sometimes required to stop/abort a request being processed at the server side. How can I get my NodeJs server to abort a request even when it's not…
Rahul Bhatnagar
  • 627
  • 5
  • 6
2
votes
2 answers

Canceling an ajax request: can the handler still be executed

In Is JavaScript guaranteed to be single-threaded? it becomes clear that however javascript is single threaded there are still caveats. I was wondering whether the following pseudo-code is always predictable (I'm 'using' jQuery) var…
Jaap
  • 3,081
  • 2
  • 29
  • 50
1
vote
2 answers

How to Correctly Cancel a TPL Task with Continuation

I have a long running operation which I am putting on a background thread using TPL. What I have currently works but I am confused over where I should be handling my AggregateException during a cancellation request. In a button click event I start…
1
vote
3 answers

how to cancel WCF service call?

I have a WCF function that is executing long time, so I call the function in UI with backgraundworker... I want to give a feature to cancel the execution, so I abort IComunicationObject, the problem is that Service execution is not stoping, Is…
Arsen Mkrtchyan
  • 49,896
  • 32
  • 148
  • 184
1
vote
1 answer

axios cancellation caught inside of then() instead of catch()

I making a multi-upload file form. Upon user cancellation, once the corresponding axios call get cancelled using cancel(), I having a weird behaviour. My axios call get caught inside the then() whereas it should be caught inside of catch(). The…