You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
540 B

using Minio.DataModel.Result;
using Minio.Handlers;
using Polly;
namespace Minio.Examples.Cases;
public class RetryPolicyHandler : IRetryPolicyHandler
{
private readonly AsyncPolicy<ResponseResult> policy;
public RetryPolicyHandler(AsyncPolicy<ResponseResult> policy)
{
this.policy = policy ?? throw new ArgumentNullException(nameof(policy));
}
public Task<ResponseResult> Handle(Func<Task<ResponseResult>> executeRequestCallback)
{
return policy.ExecuteAsync(executeRequestCallback);
}
}