@@ -24,8 +24,12 @@ public static partial class Extensions
2424 /// <param name="cancellationToken">An optional cancellation token.</param>
2525 /// <returns>A task containing the count of items written that completes when all the data has been written to the channel writer.
2626 /// The count should be ignored if the number of iterations could exceed the max value of long.</returns>
27- public static async ValueTask < long > WriteAllAsync < T > ( this ChannelWriter < T > target ,
28- IEnumerable < ValueTask < T > > source , bool complete = false , bool deferredExecution = false , CancellationToken cancellationToken = default )
27+ public static async ValueTask < long > WriteAllAsync < T > (
28+ this ChannelWriter < T > target ,
29+ IEnumerable < ValueTask < T > > source ,
30+ bool complete = false ,
31+ bool deferredExecution = false ,
32+ CancellationToken cancellationToken = default )
2933 {
3034 if ( target is null ) throw new ArgumentNullException ( nameof ( target ) ) ;
3135 if ( source is null ) throw new ArgumentNullException ( nameof ( source ) ) ;
@@ -73,8 +77,11 @@ public static async ValueTask<long> WriteAllAsync<T>(this ChannelWriter<T> targe
7377 /// <param name="cancellationToken">The cancellation token.</param>
7478 /// <returns>A task containing the count of items written that completes when all the data has been written to the channel writer.
7579 /// The count should be ignored if the number of iterations could exceed the max value of long.</returns>
76- public static ValueTask < long > WriteAllAsync < T > ( this ChannelWriter < T > target ,
77- IEnumerable < ValueTask < T > > source , bool complete , CancellationToken cancellationToken )
80+ public static ValueTask < long > WriteAllAsync < T > (
81+ this ChannelWriter < T > target ,
82+ IEnumerable < ValueTask < T > > source ,
83+ bool complete ,
84+ CancellationToken cancellationToken )
7885 => WriteAllAsync ( target , source , complete , false , cancellationToken ) ;
7986
8087 /// <summary>
@@ -88,8 +95,12 @@ public static ValueTask<long> WriteAllAsync<T>(this ChannelWriter<T> target,
8895 /// <param name="cancellationToken">An optional cancellation token.</param>
8996 /// <returns>A task containing the count of items written that completes when all the data has been written to the channel writer.
9097 /// The count should be ignored if the number of iterations could exceed the max value of long.</returns>
91- public static ValueTask < long > WriteAllAsync < T > ( this ChannelWriter < T > target ,
92- IEnumerable < Task < T > > source , bool complete = false , bool deferredExecution = false , CancellationToken cancellationToken = default )
98+ public static ValueTask < long > WriteAllAsync < T > (
99+ this ChannelWriter < T > target ,
100+ IEnumerable < Task < T > > source ,
101+ bool complete = false ,
102+ bool deferredExecution = false ,
103+ CancellationToken cancellationToken = default )
93104 {
94105 if ( target is null ) throw new ArgumentNullException ( nameof ( target ) ) ;
95106 if ( source is null ) throw new ArgumentNullException ( nameof ( source ) ) ;
@@ -113,8 +124,11 @@ public static ValueTask<long> WriteAllAsync<T>(this ChannelWriter<T> target,
113124 /// <param name="cancellationToken">The cancellation token.</param>
114125 /// <returns>A task containing the count of items written that completes when all the data has been written to the channel writer.
115126 /// The count should be ignored if the number of iterations could exceed the max value of long.</returns>
116- public static ValueTask < long > WriteAllAsync < T > ( this ChannelWriter < T > target ,
117- IEnumerable < Task < T > > source , bool complete , CancellationToken cancellationToken )
127+ public static ValueTask < long > WriteAllAsync < T > (
128+ this ChannelWriter < T > target ,
129+ IEnumerable < Task < T > > source ,
130+ bool complete ,
131+ CancellationToken cancellationToken )
118132 => WriteAllAsync ( target , source , complete , false , cancellationToken ) ;
119133
120134 /// <summary>
@@ -128,8 +142,12 @@ public static ValueTask<long> WriteAllAsync<T>(this ChannelWriter<T> target,
128142 /// <param name="cancellationToken">An optional cancellation token.</param>
129143 /// <returns>A task containing the count of items written that completes when all the data has been written to the channel writer.
130144 /// The count should be ignored if the number of iterations could exceed the max value of long.</returns>
131- public static ValueTask < long > WriteAllAsync < T > ( this ChannelWriter < T > target ,
132- IEnumerable < Func < T > > source , bool complete = false , bool deferredExecution = false , CancellationToken cancellationToken = default )
145+ public static ValueTask < long > WriteAllAsync < T > (
146+ this ChannelWriter < T > target ,
147+ IEnumerable < Func < T > > source ,
148+ bool complete = false ,
149+ bool deferredExecution = false ,
150+ CancellationToken cancellationToken = default )
133151 {
134152 if ( target is null ) throw new ArgumentNullException ( nameof ( target ) ) ;
135153 if ( source is null ) throw new ArgumentNullException ( nameof ( source ) ) ;
@@ -153,8 +171,11 @@ public static ValueTask<long> WriteAllAsync<T>(this ChannelWriter<T> target,
153171 /// <param name="cancellationToken">The cancellation token.</param>
154172 /// <returns>A task containing the count of items written that completes when all the data has been written to the channel writer.
155173 /// The count should be ignored if the number of iterations could exceed the max value of long.</returns>
156- public static ValueTask < long > WriteAllAsync < T > ( this ChannelWriter < T > target ,
157- IEnumerable < Func < T > > source , bool complete , CancellationToken cancellationToken )
174+ public static ValueTask < long > WriteAllAsync < T > (
175+ this ChannelWriter < T > target ,
176+ IEnumerable < Func < T > > source ,
177+ bool complete ,
178+ CancellationToken cancellationToken )
158179 => WriteAllAsync ( target , source , complete , false , cancellationToken ) ;
159180
160181 /// <summary>
@@ -168,8 +189,12 @@ public static ValueTask<long> WriteAllAsync<T>(this ChannelWriter<T> target,
168189 /// <param name="cancellationToken">An optional cancellation token.</param>
169190 /// <returns>A task containing the count of items written that completes when all the data has been written to the channel writer.
170191 /// The count should be ignored if the number of iterations could exceed the max value of long.</returns>
171- public static ValueTask < long > WriteAll < T > ( this ChannelWriter < T > target ,
172- IEnumerable < T > source , bool complete = false , bool deferredExecution = false , CancellationToken cancellationToken = default )
192+ public static ValueTask < long > WriteAll < T > (
193+ this ChannelWriter < T > target ,
194+ IEnumerable < T > source ,
195+ bool complete = false ,
196+ bool deferredExecution = false ,
197+ CancellationToken cancellationToken = default )
173198 {
174199 if ( target is null ) throw new ArgumentNullException ( nameof ( target ) ) ;
175200 if ( source is null ) throw new ArgumentNullException ( nameof ( source ) ) ;
@@ -193,8 +218,11 @@ public static ValueTask<long> WriteAll<T>(this ChannelWriter<T> target,
193218 /// <param name="cancellationToken">The cancellation token.</param>
194219 /// <returns>A task containing the count of items written that completes when all the data has been written to the channel writer.
195220 /// The count should be ignored if the number of iterations could exceed the max value of long.</returns>
196- public static ValueTask < long > WriteAll < T > ( this ChannelWriter < T > target ,
197- IEnumerable < T > source , bool complete , CancellationToken cancellationToken )
221+ public static ValueTask < long > WriteAll < T > (
222+ this ChannelWriter < T > target ,
223+ IEnumerable < T > source ,
224+ bool complete ,
225+ CancellationToken cancellationToken )
198226 => WriteAll ( target , source , complete , false , cancellationToken ) ;
199227
200228
@@ -209,8 +237,12 @@ public static ValueTask<long> WriteAll<T>(this ChannelWriter<T> target,
209237 /// <returns>A task containing the count of items written that completes when all the data has been written to the channel writer.
210238 /// The count should be ignored if the number of iterations could exceed the max value of long.</returns>
211239 [ System . Diagnostics . CodeAnalysis . SuppressMessage ( "Reliability" , "CA2012:Use ValueTasks correctly" , Justification = "Is used correctly." ) ]
212- public static async ValueTask < long > WriteAllLines ( this ChannelWriter < string > target ,
213- TextReader source , bool complete = false , bool deferredExecution = false , CancellationToken cancellationToken = default )
240+ public static async ValueTask < long > WriteAllLines (
241+ this ChannelWriter < string > target ,
242+ TextReader source ,
243+ bool complete = false ,
244+ bool deferredExecution = false ,
245+ CancellationToken cancellationToken = default )
214246 {
215247 if ( target is null ) throw new ArgumentNullException ( nameof ( target ) ) ;
216248 if ( source is null ) throw new ArgumentNullException ( nameof ( source ) ) ;
@@ -270,8 +302,11 @@ public static async ValueTask<long> WriteAllLines(this ChannelWriter<string> tar
270302 /// <param name="cancellationToken">An optional cancellation token.</param>
271303 /// <returns>A task containing the count of items written that completes when all the data has been written to the channel writer.
272304 /// The count should be ignored if the number of iterations could exceed the max value of long.</returns>
273- public static ValueTask < long > WriteAllLines ( this ChannelWriter < string > target ,
274- TextReader source , bool complete , CancellationToken cancellationToken )
305+ public static ValueTask < long > WriteAllLines (
306+ this ChannelWriter < string > target ,
307+ TextReader source ,
308+ bool complete ,
309+ CancellationToken cancellationToken )
275310 => WriteAllLines ( target , source , complete , false , cancellationToken ) ;
276311
277312#if NETSTANDARD2_1
@@ -286,8 +321,12 @@ public static ValueTask<long> WriteAllLines(this ChannelWriter<string> target,
286321 /// <param name="cancellationToken">An optional cancellation token.</param>
287322 /// <returns>A task containing the count of items written that completes when all the data has been written to the channel writer.
288323 /// The count should be ignored if the number of iterations could exceed the max value of long.</returns>
289- public static async ValueTask < long > WriteAllAsync < T > ( this ChannelWriter < T > target ,
290- IAsyncEnumerable < T > source , bool complete = false , bool deferredExecution = false , CancellationToken cancellationToken = default )
324+ public static async ValueTask < long > WriteAllAsync < T > (
325+ this ChannelWriter < T > target ,
326+ IAsyncEnumerable < T > source ,
327+ bool complete = false ,
328+ bool deferredExecution = false ,
329+ CancellationToken cancellationToken = default )
291330 {
292331 if ( target is null ) throw new ArgumentNullException ( nameof ( target ) ) ;
293332 if ( source is null ) throw new ArgumentNullException ( nameof ( source ) ) ;
@@ -336,8 +375,11 @@ await target
336375 /// <param name="cancellationToken">An optional cancellation token.</param>
337376 /// <returns>A task containing the count of items written that completes when all the data has been written to the channel writer.
338377 /// The count should be ignored if the number of iterations could exceed the max value of long.</returns>
339- public static ValueTask < long > WriteAllAsync < T > ( this ChannelWriter < T > target ,
340- IAsyncEnumerable < T > source , bool complete , CancellationToken cancellationToken )
378+ public static ValueTask < long > WriteAllAsync < T > (
379+ this ChannelWriter < T > target ,
380+ IAsyncEnumerable < T > source ,
381+ bool complete ,
382+ CancellationToken cancellationToken )
341383 => WriteAllAsync ( target , source , complete , false , cancellationToken ) ;
342384#endif
343385}
0 commit comments