Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Web Service and multiple requests from the same client

Tags:

service

If I have a client app sending requests to my web service, one after another, will the web service be able to handle each request made and not override previous request because of a new request made? I want all requests to be handled and not replaced for another. Will I be able to do this with the multiple requests all coming from the same client

like image 593
brandon Avatar asked Feb 28 '23 03:02

brandon


1 Answers

I have no idea why the other answer is so long to what is essentially a simple question about the basics but the answer is yes.

Each request is independent of others, unless you specifically program some sort of crossover into the server (e.g. a static cross-thread list used by every request or a more complex structure).

It is easier to encounter crossover on the client side, if using an asynchronous pattern that gives results via events - you need to make sure you got the result to the correct request (generally done by providing some token as the "custom state" variable, which you can use to determine the original request in the response handler).

like image 173
Sander Avatar answered Mar 10 '23 10:03

Sander