I have a web service, where data for an identifier can be gotten (e.g. billing information for a customer id). In my client there are multiple threads. These threads call the method at the web service to get the data for the identifier.
Now it happens, that during a request to the web service for e.g CustomerID = 12345
another thread tries to call the web service for the same customer. Now I want to spare the server und to recycle the result of the request.
Therefore I want to wait the second thread until the result of the first request is gotten and return the result also to the second thread.
An important requirement is, that if the second thread wants to get the data after the web request returned, a new request has to be sent. To illustrate my problem, I show a :
Can anybody explain me, how I can achieve this in C#.