Reformat/cleanup
All checks were successful
NuGet Package Publish / nuget (push) Successful in 1m10s
All checks were successful
NuGet Package Publish / nuget (push) Successful in 1m10s
This commit is contained in:
@@ -1,27 +1,28 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ZB.MOM.WW.CBDDC.Core.Resilience
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ZB.MOM.WW.CBDDC.Core.Resilience;
|
||||
|
||||
public interface IRetryPolicy
|
||||
{
|
||||
public interface IRetryPolicy
|
||||
{
|
||||
/// <summary>
|
||||
/// Executes an asynchronous operation with retry handling.
|
||||
/// </summary>
|
||||
/// <param name="operation">The operation to execute.</param>
|
||||
/// <param name="operationName">The operation name used for diagnostics.</param>
|
||||
/// <param name="cancellationToken">A token used to cancel the operation.</param>
|
||||
/// <returns>A task that represents the asynchronous execution.</returns>
|
||||
Task ExecuteAsync(Func<Task> operation, string operationName, CancellationToken cancellationToken = default);
|
||||
/// <summary>
|
||||
/// Executes an asynchronous operation with retry handling and returns a result.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The result type.</typeparam>
|
||||
/// <param name="operation">The operation to execute.</param>
|
||||
/// <param name="operationName">The operation name used for diagnostics.</param>
|
||||
/// <param name="cancellationToken">A token used to cancel the operation.</param>
|
||||
/// <returns>A task that represents the asynchronous execution and yields the operation result.</returns>
|
||||
Task<T> ExecuteAsync<T>(Func<Task<T>> operation, string operationName, CancellationToken cancellationToken = default);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Executes an asynchronous operation with retry handling.
|
||||
/// </summary>
|
||||
/// <param name="operation">The operation to execute.</param>
|
||||
/// <param name="operationName">The operation name used for diagnostics.</param>
|
||||
/// <param name="cancellationToken">A token used to cancel the operation.</param>
|
||||
/// <returns>A task that represents the asynchronous execution.</returns>
|
||||
Task ExecuteAsync(Func<Task> operation, string operationName, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// Executes an asynchronous operation with retry handling and returns a result.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The result type.</typeparam>
|
||||
/// <param name="operation">The operation to execute.</param>
|
||||
/// <param name="operationName">The operation name used for diagnostics.</param>
|
||||
/// <param name="cancellationToken">A token used to cancel the operation.</param>
|
||||
/// <returns>A task that represents the asynchronous execution and yields the operation result.</returns>
|
||||
Task<T> ExecuteAsync<T>(Func<Task<T>> operation, string operationName,
|
||||
CancellationToken cancellationToken = default);
|
||||
}
|
||||
Reference in New Issue
Block a user