Decompile

CancellationToken

Use token to cancel long-running tasks.

CancellationTokenSource tokenSource = new();
 
try
{
    await httpClient.GetAsync("http://someApi/endpoint", tokenSource.Token)
}
catch (TokenCancellationException ex)
{
    logger.LogInformation(ex, "token cancelled");
}
catch (Exception ex)
{
    throw;
}