I have service A which calls service B using a client to the service which also has a default timeout of 5 seconds.
The code in service A looks like this:
var response = _serviceBClient.DoStuff(requestParams, cancellationToken).ContinueWith(task =>
{
...
}
, cancellationToken)
The client then makes a rest call to Service B controller using PostAsync and passes the CT it got.
I want to be able to recognize the 2 cases inside service B: when the CT from service A is canceled vs the HttpClient received a timeout. Is there a way to do it?