You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Gets the aggregate exception associated with the <see cref="RequestHandler"/> instance.
@@ -102,6 +103,24 @@ public int? StaticDegreeOfParallelism
102
103
/// </summary>
103
104
publicintCount=>_requestsChannel.Count;
104
105
106
+
/// <summary>
107
+
/// Initializes a new instance of the <see cref="RequestHandler"/> class with a priority channel.
108
+
/// If the priority count is zero, an exception is thrown; otherwise, a fixed-size priority channel is created.
109
+
/// If the priority count is null, a dynamic-size priority channel is created.
110
+
/// </summary>
111
+
/// <param name="priorityCount">The number of priority levels for the fixed-size priority channel. If zero, an exception is thrown. If null, a dynamic-size priority channel is used.</param>
112
+
/// <exception cref="ArgumentOutOfRangeException">Thrown if the priority count is negative or zero.</exception>
113
+
publicRequestHandler(intpriorityCount=3)
114
+
{
115
+
if(priorityCount<0)
116
+
thrownewArgumentOutOfRangeException(nameof(priorityCount),"Priority count cannot be negative.");
117
+
118
+
_requestsChannel=priorityCount>0?
119
+
newFixedPriorityChannel<IRequest>(priorityCount)
120
+
:newDynamicPriorityChannel<IRequest>();
121
+
}
122
+
123
+
105
124
/// <summary>
106
125
/// Constructor for the <see cref="RequestHandler"/> class.
107
126
/// </summary>
@@ -113,20 +132,6 @@ public RequestHandler(params IRequest[] requests) : this()
/// Initializes a new instance of the <see cref="RequestHandler"/> class with a priority channel.
118
-
/// If the priority count is zero, a dynamic-size priority channel is created; otherwise, a fixed-size priority channel is created.
119
-
/// </summary>
120
-
/// <param name="priorityCount">The number of priority levels for the fixed-size priority channel. If zero, a dynamic-size priority channel is used.</param>
121
-
/// <exception cref="ArgumentOutOfRangeException">Thrown if the priority count is negative.</exception>
122
-
publicRequestHandler(intpriorityCount=3)
123
-
{
124
-
if(priorityCount<0)
125
-
thrownewArgumentOutOfRangeException(nameof(priorityCount),"Priority count cannot be negative.");
<Description>Requests is your go-to C# .NET 6 library for handling requests in a parallel async state. It’s like having a reliable co-pilot for your code. With features like priority settings, retry functions, and expandable classes, it’s the perfect companion for HTTP requests and other CPU-intensive tasks. Features include retry functions, priority settings, and notification delegates.</Description>
11
+
<Description>A C# .NET 6 library for parallel async request handling. Features include priority settings, retry functions, and expandable classes, making it ideal for HTTP requests and CPU-intensive tasks.</Description>
0 commit comments