Skip to content

Commit 41606b4

Browse files
committed
xml commenting
1 parent 51c3105 commit 41606b4

4 files changed

Lines changed: 65 additions & 0 deletions

File tree

src/Soenneker.Utils.RateLimiting.Executor/Abstract/IRateLimitingExecutor.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ public interface IRateLimitingExecutor : IDisposable, IAsyncDisposable
4747
/// <returns>A task that represents the asynchronous operation and returns a result of type <typeparamref name="T"/>.</returns>
4848
ValueTask<T> Execute<T, TArg>(Func<CancellationToken, TArg, ValueTask<T>> valueTask, TArg argument, CancellationToken cancellationToken = default);
4949

50+
/// <summary>
51+
/// Executes the execute task operation.
52+
/// </summary>
53+
/// <param name="task">The task.</param>
54+
/// <param name="cancellationToken">The cancellation token.</param>
55+
/// <returns>A task that represents the asynchronous operation.</returns>
5056
Task ExecuteTask(Func<CancellationToken, Task> task, CancellationToken cancellationToken = default);
5157

5258
/// <summary>
@@ -96,5 +102,8 @@ public interface IRateLimitingExecutor : IDisposable, IAsyncDisposable
96102
/// <param name="cancellationToken"></param>
97103
void Execute(Action<CancellationToken> action, CancellationToken cancellationToken = default);
98104

105+
/// <summary>
106+
/// Executes the cancel execution operation.
107+
/// </summary>
99108
void CancelExecution();
100109
}

src/Soenneker.Utils.RateLimiting.Executor/RateLimitingExecutor.Sync.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
namespace Soenneker.Utils.RateLimiting.Executor;
55

6+
/// <summary>
7+
/// Represents the rate limiting executor.
8+
/// </summary>
69
public sealed partial class RateLimitingExecutor
710
{
811
private T ExecuteInternal<T>(Func<CancellationToken, T> task, CancellationToken cancellationToken)
@@ -21,12 +24,33 @@ private T ExecuteInternal<T>(Func<CancellationToken, T> task, CancellationToken
2124
}
2225
}
2326

27+
/// <summary>
28+
/// Executes the execute operation.
29+
/// </summary>
30+
/// <typeparam name="T">The T type.</typeparam>
31+
/// <param name="action">The action.</param>
32+
/// <param name="cancellationToken">The cancellation token.</param>
33+
/// <returns>The result of the operation.</returns>
2434
public T Execute<T>(Func<CancellationToken, T> action, CancellationToken cancellationToken = default) =>
2535
ExecuteInternal(action, cancellationToken);
2636

37+
/// <summary>
38+
/// Executes the execute operation.
39+
/// </summary>
40+
/// <typeparam name="T">The T type.</typeparam>
41+
/// <typeparam name="TArg">The TArg type.</typeparam>
42+
/// <param name="action">The action.</param>
43+
/// <param name="argument">The argument.</param>
44+
/// <param name="cancellationToken">The cancellation token.</param>
45+
/// <returns>The result of the operation.</returns>
2746
public T Execute<T, TArg>(Func<CancellationToken, TArg, T> action, TArg argument, CancellationToken cancellationToken = default) =>
2847
ExecuteInternal(token => action(token, argument), cancellationToken);
2948

49+
/// <summary>
50+
/// Executes the execute operation.
51+
/// </summary>
52+
/// <param name="action">The action.</param>
53+
/// <param name="cancellationToken">The cancellation token.</param>
3054
public void Execute(Action<CancellationToken> action, CancellationToken cancellationToken = default) =>
3155
ExecuteInternal(token =>
3256
{

src/Soenneker.Utils.RateLimiting.Executor/RateLimitingExecutor.Task.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
namespace Soenneker.Utils.RateLimiting.Executor;
88

9+
/// <summary>
10+
/// Represents the rate limiting executor.
11+
/// </summary>
912
public sealed partial class RateLimitingExecutor
1013
{
1114
private async Task<T> ExecuteTaskInternal<T>(Func<CancellationToken, Task<T>> task, CancellationToken cancellationToken)
@@ -24,18 +27,40 @@ private async Task<T> ExecuteTaskInternal<T>(Func<CancellationToken, Task<T>> ta
2427
}
2528
}
2629

30+
/// <summary>
31+
/// Executes the execute task operation.
32+
/// </summary>
33+
/// <param name="task">The task.</param>
34+
/// <param name="cancellationToken">The cancellation token.</param>
35+
/// <returns>A task that represents the asynchronous operation.</returns>
2736
public async Task ExecuteTask(Func<CancellationToken, Task> task, CancellationToken cancellationToken = default) =>
2837
await ExecuteTaskInternal(async token =>
2938
{
3039
await task(token);
3140
return 0;
3241
}, cancellationToken).NoSync();
3342

43+
/// <summary>
44+
/// Executes the execute task operation.
45+
/// </summary>
46+
/// <typeparam name="T">The T type.</typeparam>
47+
/// <param name="task">The task.</param>
48+
/// <param name="cancellationToken">The cancellation token.</param>
49+
/// <returns>A task containing the result of the operation.</returns>
3450
public Task<T> ExecuteTask<T>(Func<CancellationToken, Task<T>> task, CancellationToken cancellationToken = default)
3551
{
3652
return ExecuteTaskInternal(task, cancellationToken);
3753
}
3854

55+
/// <summary>
56+
/// Executes the execute task operation.
57+
/// </summary>
58+
/// <typeparam name="T">The T type.</typeparam>
59+
/// <typeparam name="TArg">The TArg type.</typeparam>
60+
/// <param name="task">The task.</param>
61+
/// <param name="argument">The argument.</param>
62+
/// <param name="cancellationToken">The cancellation token.</param>
63+
/// <returns>A task containing the result of the operation.</returns>
3964
public Task<T> ExecuteTask<T, TArg>(Func<CancellationToken, TArg, Task<T>> task, TArg argument, CancellationToken cancellationToken = default)
4065
{
4166
return ExecuteTaskInternal(token => task(token, argument), cancellationToken);

src/Soenneker.Utils.RateLimiting.Executor/RateLimitingExecutor.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ public void CancelExecution()
9090
}
9191
}
9292

93+
/// <summary>
94+
/// Asynchronously releases resources used by the current instance.
95+
/// </summary>
96+
/// <returns>A task that represents the asynchronous operation.</returns>
9397
public async ValueTask DisposeAsync()
9498
{
9599
if (_cancellationTokenSource.IsValueCreated && !_cancellationTokenSource.Value.IsCancellationRequested)
@@ -104,6 +108,9 @@ await _cancellationTokenSource.Value.CancelAsync()
104108
}
105109
}
106110

111+
/// <summary>
112+
/// Releases resources used by the current instance.
113+
/// </summary>
107114
public void Dispose()
108115
{
109116
if (_cancellationTokenSource.IsValueCreated && !_cancellationTokenSource.Value.IsCancellationRequested)

0 commit comments

Comments
 (0)