2

I am using service stack to build the create RESTful services, not have depth knowledge of it. This works as sending request and getting response back. I have scenario and my question is depends on it.

Scenario: I am sending request from browser or any client where I am able to send request to server. Consider server will take 3 seconds to process single request and send back response to browser. After one second, I have sent another request to server from same browser(client). Now I am getting response of second request which I sent later.

Question 1: What is happening behind with the first request which I did not get response.

Question 2: How I can stop processing of orphan request.

Edit : I have used IIS server to host services.

Ravindra Sinare
  • 675
  • 1
  • 9
  • 25

1 Answers1

3

ServiceStack executes requests concurrently on multithreaded web servers, whether you're hosting on ASP.NET/IIS or self-hosted so 2 concurrent requests are running concurrently on different threads. There are different scenarios possible if you're executing async tasks in your Services in which it frees up the thread to execute different tasks, but the implementation details are largely irrelevant here.

HTTP Web Requests are each executed to their end, even when its client connection is lost your Services are never notified and no Exceptions are raised.

But for long running Services you can enable the high-level ServiceStack's Cancellable Requests Feature which enables a way for clients to cancel long running requests.

mythz
  • 141,670
  • 29
  • 246
  • 390
  • I got this, if client collection is lost your Services are never notified and no Exceptions are raised, but question 1 is still unanswered. – Ravindra Sinare Mar 16 '17 at 14:18
  • @RavindraSinare it was answered, there both being run concurrently on different Threads – mythz Mar 16 '17 at 14:19
  • 1
    What in case of two already running concurrently and before its going to complete both of them I am sending third one? What happen both of them? – Ravindra Sinare Mar 16 '17 at 14:50
  • 2
    @RavindraSinare Seriously? Nothing happens to them, they're all being run concurrently in their own thread in isolation. – mythz Mar 16 '17 at 16:46