2020-05-02 18:57:31 +01:00
|
|
|
using System;
|
2022-11-18 11:30:09 +00:00
|
|
|
using System.Threading;
|
2020-05-02 18:57:31 +01:00
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
namespace SpotifyAPI.Web.Http
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// The Retry Handler will be directly called after the response is retrived and before errors and body are processed.
|
|
|
|
/// </summary>
|
|
|
|
public interface IRetryHandler
|
|
|
|
{
|
2022-11-18 11:30:09 +00:00
|
|
|
delegate Task<IResponse> RetryFunc(IRequest request, CancellationToken cancel = default);
|
2020-06-03 16:44:13 +01:00
|
|
|
|
2022-11-18 11:30:09 +00:00
|
|
|
Task<IResponse> HandleRetry(IRequest request, IResponse response, RetryFunc retry, CancellationToken cancel = default);
|
2020-05-02 18:57:31 +01:00
|
|
|
}
|
|
|
|
}
|