From 0bd9c47353f1539f76297e014b4fd98c20a1f55e Mon Sep 17 00:00:00 2001 From: electricessence <5899455+electricessence@users.noreply.github.com> Date: Thu, 25 Jan 2024 20:09:46 -0800 Subject: [PATCH 1/5] Isolate System.Threading.Channels ref for NET Standard. --- Open.ChannelExtensions/Open.ChannelExtensions.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Open.ChannelExtensions/Open.ChannelExtensions.csproj b/Open.ChannelExtensions/Open.ChannelExtensions.csproj index cd51c03..c2da408 100644 --- a/Open.ChannelExtensions/Open.ChannelExtensions.csproj +++ b/Open.ChannelExtensions/Open.ChannelExtensions.csproj @@ -22,7 +22,7 @@ git true true - 7.0.0 + 7.0.1 MIT true @@ -47,7 +47,7 @@ - + From b8fc88fd2e693ada272088cdf94edc17c5ffe806 Mon Sep 17 00:00:00 2001 From: electricessence <5899455+electricessence@users.noreply.github.com> Date: Thu, 25 Jan 2024 20:11:10 -0800 Subject: [PATCH 2/5] Isolate System.Threading.Channels ref for NET Standard. --- Open.ChannelExtensions/Open.ChannelExtensions.csproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Open.ChannelExtensions/Open.ChannelExtensions.csproj b/Open.ChannelExtensions/Open.ChannelExtensions.csproj index 8f0786b..d02c8f3 100644 --- a/Open.ChannelExtensions/Open.ChannelExtensions.csproj +++ b/Open.ChannelExtensions/Open.ChannelExtensions.csproj @@ -22,7 +22,7 @@ git true true - 6.3.0 + 6.3.1 MIT true @@ -38,8 +38,8 @@ - True - \ + True + \ True @@ -47,7 +47,7 @@ - + From 913b178d9c602712c047d3dc1468345d6cc79413 Mon Sep 17 00:00:00 2001 From: electricessence <5899455+electricessence@users.noreply.github.com> Date: Tue, 30 Jan 2024 21:32:09 -0800 Subject: [PATCH 3/5] Correct compiler directives. --- Open.ChannelExtensions.ComparisonTests/Program.cs | 2 -- Open.ChannelExtensions.Tests/BatchTests.cs | 2 -- Open.ChannelExtensions/Extensions.Source.cs | 3 ++- Open.ChannelExtensions/Extensions.Write.cs | 3 ++- Open.ChannelExtensions/Extensions._.cs | 3 ++- Open.ChannelExtensions/Open.ChannelExtensions.csproj | 2 +- 6 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Open.ChannelExtensions.ComparisonTests/Program.cs b/Open.ChannelExtensions.ComparisonTests/Program.cs index abaef46..3be1bc9 100644 --- a/Open.ChannelExtensions.ComparisonTests/Program.cs +++ b/Open.ChannelExtensions.ComparisonTests/Program.cs @@ -106,7 +106,6 @@ await Enumerable Console.WriteLine(); } -#if NETCOREAPP3_0 { Console.WriteLine("Async Enumerable test..."); var sw = Stopwatch.StartNew(); @@ -120,7 +119,6 @@ await Enumerable Console.WriteLine(sw.Elapsed); Console.WriteLine(); } -#endif } diff --git a/Open.ChannelExtensions.Tests/BatchTests.cs b/Open.ChannelExtensions.Tests/BatchTests.cs index ac1aa6e..c092581 100644 --- a/Open.ChannelExtensions.Tests/BatchTests.cs +++ b/Open.ChannelExtensions.Tests/BatchTests.cs @@ -259,7 +259,6 @@ public static async Task TimeoutTest1() })); } -#if NET5_0_OR_GREATER [Fact] public static async Task BatchReadBehavior() { @@ -408,5 +407,4 @@ public static async IAsyncEnumerable> ReadBatchEnumerableAsyncBakedIn 0) yield return item; } } -#endif } diff --git a/Open.ChannelExtensions/Extensions.Source.cs b/Open.ChannelExtensions/Extensions.Source.cs index 81605eb..c1139fa 100644 --- a/Open.ChannelExtensions/Extensions.Source.cs +++ b/Open.ChannelExtensions/Extensions.Source.cs @@ -255,7 +255,8 @@ public static ChannelReader Source( CancellationToken cancellationToken) => Source(target, source, out _, false, cancellationToken); -#if NETSTANDARD2_1 +#if NETSTANDARD2_0 +#else /// public static ChannelReader Source( this Channel target, diff --git a/Open.ChannelExtensions/Extensions.Write.cs b/Open.ChannelExtensions/Extensions.Write.cs index 4e54228..15e4d43 100644 --- a/Open.ChannelExtensions/Extensions.Write.cs +++ b/Open.ChannelExtensions/Extensions.Write.cs @@ -309,7 +309,8 @@ public static ValueTask WriteAllLines( CancellationToken cancellationToken) => WriteAllLines(target, source, complete, false, cancellationToken); -#if NETSTANDARD2_1 +#if NETSTANDARD2_0 +#else /// /// Asynchronously writes all entries from the source to the channel. /// diff --git a/Open.ChannelExtensions/Extensions._.cs b/Open.ChannelExtensions/Extensions._.cs index b4c8030..955b2c0 100644 --- a/Open.ChannelExtensions/Extensions._.cs +++ b/Open.ChannelExtensions/Extensions._.cs @@ -266,7 +266,8 @@ public static ChannelReader ToChannel(this IEnumerable source, => CreateChannel(capacity, singleReader) .Source(source, deferredExecution, cancellationToken); -#if NETSTANDARD2_1 +#if NETSTANDARD2_0 +#else /// /// Writes all entries from the source to a channel and calls complete when finished. /// diff --git a/Open.ChannelExtensions/Open.ChannelExtensions.csproj b/Open.ChannelExtensions/Open.ChannelExtensions.csproj index d02c8f3..c7b941b 100644 --- a/Open.ChannelExtensions/Open.ChannelExtensions.csproj +++ b/Open.ChannelExtensions/Open.ChannelExtensions.csproj @@ -22,7 +22,7 @@ git true true - 6.3.1 + 6.3.2 MIT true From cf70fdcd8c5e12d51063d5c9719322dcb3005e99 Mon Sep 17 00:00:00 2001 From: electricessence <5899455+electricessence@users.noreply.github.com> Date: Tue, 30 Jan 2024 21:36:09 -0800 Subject: [PATCH 4/5] Inspection fixes. --- Open.ChannelExtensions.Tests/AssumptionTests.cs | 4 ++-- Open.ChannelExtensions.Tests/BatchTests.cs | 2 +- Open.ChannelExtensions.Tests/SpecialTests.cs | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Open.ChannelExtensions.Tests/AssumptionTests.cs b/Open.ChannelExtensions.Tests/AssumptionTests.cs index b78d528..c0921d7 100644 --- a/Open.ChannelExtensions.Tests/AssumptionTests.cs +++ b/Open.ChannelExtensions.Tests/AssumptionTests.cs @@ -10,7 +10,7 @@ public static async Task WaitCancellation() { CancellationToken token = tokenSource.Token; - var t = channel.Reader.WaitToReadAsync(token).ConfigureAwait(false); + var t = channel.Reader.WaitToReadAsync(token); tokenSource.Cancel(); // NOTE: a cancelled WaitToReadAsync will throw. @@ -26,7 +26,7 @@ public static async Task WaitCancellation() tokenSource.Cancel(); // NOTE: a cancelled WhenAny will not throw! - var result = await Task.WhenAny(t1.AsTask(), t2.AsTask()).ConfigureAwait(false); + var result = await Task.WhenAny(t1.AsTask(), t2.AsTask()); Assert.True(result.IsCanceled); } } diff --git a/Open.ChannelExtensions.Tests/BatchTests.cs b/Open.ChannelExtensions.Tests/BatchTests.cs index c092581..f448ab3 100644 --- a/Open.ChannelExtensions.Tests/BatchTests.cs +++ b/Open.ChannelExtensions.Tests/BatchTests.cs @@ -361,7 +361,7 @@ public static async Task ReadBatchWithTimeoutEnumerableBakedIn() Debug.WriteLine("First batch received: " + string.Join(',', batch.Select(item => item))); break; case 1: - Assert.Equal(1, batch.Count); + Assert.Single(batch); Assert.Equal(3, batch[0]); Debug.WriteLine("Second batch received: " + string.Join(',', batch.Select(item => item))); break; diff --git a/Open.ChannelExtensions.Tests/SpecialTests.cs b/Open.ChannelExtensions.Tests/SpecialTests.cs index 496b920..f7dfaef 100644 --- a/Open.ChannelExtensions.Tests/SpecialTests.cs +++ b/Open.ChannelExtensions.Tests/SpecialTests.cs @@ -21,7 +21,9 @@ public void PossibleSourceLoadingIssue() queue.CompleteAdding(); +#pragma warning disable xUnit1031 // Do not use blocking task operations in test method processingTask.Wait(); +#pragma warning restore xUnit1031 // Do not use blocking task operations in test method Assert.Equal(expectedCount, count_); From 5b48ccf2a39cb24d4f432f2670d09cff00eb3b71 Mon Sep 17 00:00:00 2001 From: electricessence <5899455+electricessence@users.noreply.github.com> Date: Tue, 30 Jan 2024 21:40:18 -0800 Subject: [PATCH 5/5] Spelling fixes. --- .../BatchingChannelReader.cs | 6 ++-- Open.ChannelExtensions/Extensions.Read.cs | 32 +++++++++---------- .../Extensions.ReadConcurrently.cs | 12 +++---- .../Extensions.Transform.cs | 6 ++-- Open.ChannelExtensions/Extensions.Write.cs | 24 +++++++------- .../Extensions.WriteConcurrently.cs | 8 ++--- Open.ChannelExtensions/Extensions._.cs | 2 +- 7 files changed, 45 insertions(+), 45 deletions(-) diff --git a/Open.ChannelExtensions/BatchingChannelReader.cs b/Open.ChannelExtensions/BatchingChannelReader.cs index 8e146c9..2c555ec 100644 --- a/Open.ChannelExtensions/BatchingChannelReader.cs +++ b/Open.ChannelExtensions/BatchingChannelReader.cs @@ -39,7 +39,7 @@ protected BatchingChannelReader( Timer? _timer; /// - /// Specifies a timeout by which a batch will be emmited there is at least one item but has been waiting + /// Specifies a timeout by which a batch will be emitted there is at least one item but has been waiting /// for longer than the timeout value. /// /// @@ -151,7 +151,7 @@ protected override bool TryPipeItems(bool flush) { if (c is null) { - newBatch = true; // a new batch could start but not be emmited. + newBatch = true; // a new batch could start but not be emitted. _batch = c = CreateBatch(_batchSize); AddBatchItem(c, item); } @@ -195,7 +195,7 @@ void Emit(ref TBatch? c) { _batch = null; newBatch = false; - if (!batched) TryUpdateTimer(Timeout.Infinite); // Since we're emmitting one, let's ensure the timeout is cancelled. + if (!batched) TryUpdateTimer(Timeout.Infinite); // Since we're emitting one, let's ensure the timeout is cancelled. batched = Buffer!.Writer.TryWrite(c!); Debug.Assert(batched); c = null; diff --git a/Open.ChannelExtensions/Extensions.Read.cs b/Open.ChannelExtensions/Extensions.Read.cs index b6c223f..846cf89 100644 --- a/Open.ChannelExtensions/Extensions.Read.cs +++ b/Open.ChannelExtensions/Extensions.Read.cs @@ -423,7 +423,7 @@ public static ValueTask ReadAllAsync(this ChannelReader reader, /// If true, calls await Task.Yield() before reading. /// The count of items read after the reader has completed. /// The count should be ignored if the number of iterations could exceed the max value of long. - [SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "Provided for aesthetic convience.")] + [SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "Provided for aesthetic convenience.")] public static ValueTask ReadAllAsync(this ChannelReader reader, CancellationToken cancellationToken, Func receiver, @@ -480,7 +480,7 @@ public static ValueTask ReadAllAsync(this ChannelIf true, calls await Task.Yield() before reading. /// The count of items read after the reader has completed. /// The count should be ignored if the number of iterations could exceed the max value of long. - [SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "Provided for aesthetic convience.")] + [SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "Provided for aesthetic convenience.")] public static ValueTask ReadAllAsync(this Channel channel, CancellationToken cancellationToken, Func receiver, @@ -532,7 +532,7 @@ public static ValueTask TaskReadAllAsync(this ChannelIf true, calls await Task.Yield() before reading. /// The count of items read after the reader has completed. /// The count should be ignored if the number of iterations could exceed the max value of long. - [SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "Provided for aesthetic convience.")] + [SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "Provided for aesthetic convenience.")] public static ValueTask TaskReadAllAsync(this Channel channel, CancellationToken cancellationToken, Func receiver, @@ -581,7 +581,7 @@ public static ValueTask ReadAllAsync(this ChannelReader reader, /// If true, calls await Task.Yield() before reading. /// The count of items read after the reader has completed. /// The count should be ignored if the number of iterations could exceed the max value of long. - [SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "Provided for aesthetic convience.")] + [SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "Provided for aesthetic convenience.")] public static ValueTask ReadAllAsync(this ChannelReader reader, CancellationToken cancellationToken, Func receiver, @@ -630,7 +630,7 @@ public static ValueTask TaskReadAllAsync(this ChannelReader reader, /// If true, calls await Task.Yield() before reading. /// The count of items read after the reader has completed. /// The count should be ignored if the number of iterations could exceed the max value of long. - [SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "Provided for aesthetic convience.")] + [SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "Provided for aesthetic convenience.")] public static ValueTask TaskReadAllAsync(this ChannelReader reader, CancellationToken cancellationToken, Func receiver, @@ -682,7 +682,7 @@ public static ValueTask TaskReadAllAsync(this ChannelIf true, calls await Task.Yield() before reading. /// The count of items read after the reader has completed. /// The count should be ignored if the number of iterations could exceed the max value of long. - [SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "Provided for aesthetic convience.")] + [SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "Provided for aesthetic convenience.")] public static ValueTask TaskReadAllAsync(this Channel channel, CancellationToken cancellationToken, Func receiver, @@ -740,7 +740,7 @@ public static ValueTask ReadAllAsync(this ChannelIf true, calls await Task.Yield() before reading. /// The count of items read after the reader has completed. /// The count should be ignored if the number of iterations could exceed the max value of long. - [SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "Provided for aesthetic convience.")] + [SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "Provided for aesthetic convenience.")] public static ValueTask ReadAllAsync(this Channel channel, CancellationToken cancellationToken, Func receiver, @@ -753,7 +753,7 @@ public static ValueTask ReadAllAsync(this ChannelThe item type. /// The channel reader to read from. /// The receiver function. - /// If true, calls await Task.Yield() before writreadinging. + /// If true, calls await Task.Yield() before reading. /// An optional cancellation token. /// The count of items read after the reader has completed. /// The count should be ignored if the number of iterations could exceed the max value of long. @@ -783,7 +783,7 @@ public static ValueTask ReadAll(this ChannelReader reader, /// The channel reader to read from. /// The receiver function. /// The cancellation token. - /// If true, calls await Task.Yield() before writreadinging. + /// If true, calls await Task.Yield() before reading. /// The count of items read after the reader has completed. /// The count should be ignored if the number of iterations could exceed the max value of long. public static ValueTask ReadAll(this ChannelReader reader, @@ -799,10 +799,10 @@ public static ValueTask ReadAll(this ChannelReader reader, /// The channel reader to read from. /// The cancellation token. /// The receiver function. - /// If true, calls await Task.Yield() before writreadinging. + /// If true, calls await Task.Yield() before reading. /// The count of items read after the reader has completed. /// The count should be ignored if the number of iterations could exceed the max value of long. - [SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "Provided for aesthetic convience.")] + [SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "Provided for aesthetic convenience.")] public static ValueTask ReadAll(this ChannelReader reader, CancellationToken cancellationToken, Action receiver, @@ -860,7 +860,7 @@ public static ValueTask ReadAll(this Channel /// If true, calls await Task.Yield() before reading. /// The count of items read after the reader has completed. /// The count should be ignored if the number of iterations could exceed the max value of long. - [SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "Provided for aesthetic convience.")] + [SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "Provided for aesthetic convenience.")] public static ValueTask ReadAll(this Channel channel, CancellationToken cancellationToken, Action receiver, @@ -921,7 +921,7 @@ public static ValueTask ReadAll(this ChannelReader reader, /// If true, calls await Task.Yield() before reading. /// The count of items read after the reader has completed. /// The count should be ignored if the number of iterations could exceed the max value of long. - [SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "Provided for aesthetic convience.")] + [SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "Provided for aesthetic convenience.")] public static ValueTask ReadAll(this ChannelReader reader, CancellationToken cancellationToken, Action receiver, @@ -978,7 +978,7 @@ public static ValueTask ReadAll(this Channel /// If true, calls await Task.Yield() before reading. /// The count of items read after the reader has completed. /// The count should be ignored if the number of iterations could exceed the max value of long. - [SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "Provided for aesthetic convience.")] + [SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "Provided for aesthetic convenience.")] public static ValueTask ReadAll(this Channel channel, CancellationToken cancellationToken, Action receiver, @@ -1020,7 +1020,7 @@ public static ValueTask ReadAllAsLines(this ChannelReader reader, /// /// The item type. /// The channel to read from. - /// The TextWriter to recieve the lines. + /// The TextWriter to receive the lines. /// If true, calls await Task.Yield() before reading. /// An optional cancellation token. /// The count of items read after the reader has completed. @@ -1041,7 +1041,7 @@ public static ValueTask ReadAllAsLines(this Channel channel, /// /// The item type. /// The channel to read from. - /// The TextWriter to recieve the lines. + /// The TextWriter to receive the lines. /// An optional cancellation token. /// If true, calls await Task.Yield() before reading. /// The count of items read after the reader has completed. diff --git a/Open.ChannelExtensions/Extensions.ReadConcurrently.cs b/Open.ChannelExtensions/Extensions.ReadConcurrently.cs index 780d3b6..490a70d 100644 --- a/Open.ChannelExtensions/Extensions.ReadConcurrently.cs +++ b/Open.ChannelExtensions/Extensions.ReadConcurrently.cs @@ -79,7 +79,7 @@ async Task Read() /// The cancellation token. /// The async receiver function. /// A task that completes when no more reading is to be done. - [SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "Provided for aesthetic convience.")] + [SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "Provided for aesthetic convenience.")] public static Task ReadAllConcurrentlyAsync(this ChannelReader reader, int maxConcurrency, CancellationToken cancellationToken, @@ -132,7 +132,7 @@ public static Task ReadAllConcurrentlyAsync(this ChannelThe cancellation token. /// The async receiver function. /// A task that completes when no more reading is to be done. - [SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "Provided for aesthetic convience.")] + [SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "Provided for aesthetic convenience.")] public static Task ReadAllConcurrentlyAsync(this Channel channel, int maxConcurrency, CancellationToken cancellationToken, @@ -190,7 +190,7 @@ public static Task ReadAllConcurrently(this ChannelReader reader, /// The cancellation token. /// The receiver function. /// A task that completes when no more reading is to be done. - [SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "Provided for aesthetic convience.")] + [SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "Provided for aesthetic convenience.")] public static Task ReadAllConcurrently(this ChannelReader reader, int maxConcurrency, CancellationToken cancellationToken, @@ -228,7 +228,7 @@ public static Task ReadAllConcurrently(this ChannelThe cancellation token. /// The receiver function. /// A task that completes when no more reading is to be done. - [SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "Provided for aesthetic convience.")] + [SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "Provided for aesthetic convenience.")] public static Task ReadAllConcurrently(this Channel channel, int maxConcurrency, CancellationToken cancellationToken, @@ -300,7 +300,7 @@ async Task Read() } /// - [SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "Provided for aesthetic convience.")] + [SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "Provided for aesthetic convenience.")] public static Task ReadAllConcurrentlyAsEnumerablesAsync(this ChannelReader reader, int maxConcurrency, CancellationToken cancellationToken, @@ -327,7 +327,7 @@ public static Task ReadAllConcurrentlyAsEnumerables(this ChannelReader rea } /// - [SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "Provided for aesthetic convience.")] + [SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "Provided for aesthetic convenience.")] public static Task ReadAllConcurrentlyAsEnumerables(this ChannelReader reader, int maxConcurrency, CancellationToken cancellationToken, diff --git a/Open.ChannelExtensions/Extensions.Transform.cs b/Open.ChannelExtensions/Extensions.Transform.cs index c26af6e..60c4cd6 100644 --- a/Open.ChannelExtensions/Extensions.Transform.cs +++ b/Open.ChannelExtensions/Extensions.Transform.cs @@ -41,7 +41,7 @@ public override ValueTask WaitToReadAsync(CancellationToken cancellationTo /// The output type of the transform. /// The source channel reader. /// The transform function. - /// A channel reader representing the tranformed results. + /// A channel reader representing the transformed results. public static ChannelReader Transform(this ChannelReader source, Func transform) => new TransformingChannelReader(source, transform); @@ -53,7 +53,7 @@ public static ChannelReader Transform(this ChannelReader /// Specifies the type of data that may be read from the channel. /// The source channel reader. /// The transform function. - /// A channel reader representing the tranformed results. + /// A channel reader representing the transformed results. public static TransformChannel Transform(this Channel source, Func transform) => new(source, transform); @@ -64,7 +64,7 @@ public static TransformChannel TransformSpecifies the type of data that may be read from the channel. /// The source channel reader. /// The transform function. - /// A channel reader representing the tranformed results. + /// A channel reader representing the transformed results. public static TransformChannel Transform(this Channel source, Func transform) => new(source, transform); } diff --git a/Open.ChannelExtensions/Extensions.Write.cs b/Open.ChannelExtensions/Extensions.Write.cs index 15e4d43..3fff867 100644 --- a/Open.ChannelExtensions/Extensions.Write.cs +++ b/Open.ChannelExtensions/Extensions.Write.cs @@ -12,7 +12,7 @@ public static partial class Extensions /// The input type of the channel. /// The channel to write to. /// The asynchronous source data to use. - /// If true, will call .Complete() if all the results have successfully been written (or the source is emtpy). + /// If true, will call .Complete() if all the results have successfully been written (or the source is empty). /// If true, calls await Task.Yield() before writing. /// An optional cancellation token. /// A task containing the count of items written that completes when all the data has been written to the channel writer. @@ -69,7 +69,7 @@ await target /// The input type of the channel. /// The channel to write to. /// The asynchronous source data to use. - /// If true, will call .Complete() if all the results have successfully been written (or the source is emtpy). + /// If true, will call .Complete() if all the results have successfully been written (or the source is empty). /// The cancellation token. /// A task containing the count of items written that completes when all the data has been written to the channel writer. /// The count should be ignored if the number of iterations could exceed the max value of long. @@ -86,7 +86,7 @@ public static ValueTask WriteAllAsync( /// The input type of the channel. /// The channel to write to. /// The asynchronous source data to use. - /// If true, will call .Complete() if all the results have successfully been written (or the source is emtpy). + /// If true, will call .Complete() if all the results have successfully been written (or the source is empty). /// If true, calls await Task.Yield() before writing. /// An optional cancellation token. /// A task containing the count of items written that completes when all the data has been written to the channel writer. @@ -116,7 +116,7 @@ public static ValueTask WriteAllAsync( /// The input type of the channel. /// The channel to write to. /// The asynchronous source data to use. - /// If true, will call .Complete() if all the results have successfully been written (or the source is emtpy). + /// If true, will call .Complete() if all the results have successfully been written (or the source is empty). /// The cancellation token. /// A task containing the count of items written that completes when all the data has been written to the channel writer. /// The count should be ignored if the number of iterations could exceed the max value of long. @@ -133,7 +133,7 @@ public static ValueTask WriteAllAsync( /// The input type of the channel. /// The channel to write to. /// The asynchronous source data to use. - /// If true, will call .Complete() if all the results have successfully been written (or the source is emtpy). + /// If true, will call .Complete() if all the results have successfully been written (or the source is empty). /// If true, calls await Task.Yield() before writing. /// An optional cancellation token. /// A task containing the count of items written that completes when all the data has been written to the channel writer. @@ -163,7 +163,7 @@ public static ValueTask WriteAllAsync( /// The input type of the channel. /// The channel to write to. /// The asynchronous source data to use. - /// If true, will call .Complete() if all the results have successfully been written (or the source is emtpy). + /// If true, will call .Complete() if all the results have successfully been written (or the source is empty). /// The cancellation token. /// A task containing the count of items written that completes when all the data has been written to the channel writer. /// The count should be ignored if the number of iterations could exceed the max value of long. @@ -180,7 +180,7 @@ public static ValueTask WriteAllAsync( /// The input type of the channel. /// The channel to write to. /// The source data to use. - /// If true, will call .Complete() if all the results have successfully been written (or the source is emtpy). + /// If true, will call .Complete() if all the results have successfully been written (or the source is empty). /// If true, calls await Task.Yield() before writing. /// An optional cancellation token. /// A task containing the count of items written that completes when all the data has been written to the channel writer. @@ -210,7 +210,7 @@ public static ValueTask WriteAll( /// The input type of the channel. /// The channel to write to. /// The source data to use. - /// If true, will call .Complete() if all the results have successfully been written (or the source is emtpy). + /// If true, will call .Complete() if all the results have successfully been written (or the source is empty). /// The cancellation token. /// A task containing the count of items written that completes when all the data has been written to the channel writer. /// The count should be ignored if the number of iterations could exceed the max value of long. @@ -226,7 +226,7 @@ public static ValueTask WriteAll( /// /// The channel to write to. /// The text reader to consume from. - /// If true, will call .Complete() if all the results have successfully been written (or the source is emtpy). + /// If true, will call .Complete() if all the results have successfully been written (or the source is empty). /// If true, calls await Task.Yield() before writing. /// An optional cancellation token. /// A task containing the count of items written that completes when all the data has been written to the channel writer. @@ -298,7 +298,7 @@ public static async ValueTask WriteAllLines( /// /// The channel to write to. /// The text reader to consume from. - /// If true, will call .Complete() if all the results have successfully been written (or the source is emtpy). + /// If true, will call .Complete() if all the results have successfully been written (or the source is empty). /// An optional cancellation token. /// A task containing the count of items written that completes when all the data has been written to the channel writer. /// The count should be ignored if the number of iterations could exceed the max value of long. @@ -317,7 +317,7 @@ public static ValueTask WriteAllLines( /// The input type of the channel. /// The channel to write to. /// The asynchronous source data to use. - /// If true, will call .Complete() if all the results have successfully been written (or the source is emtpy). + /// If true, will call .Complete() if all the results have successfully been written (or the source is empty). /// If true, calls await Task.Yield() before writing. /// An optional cancellation token. /// A task containing the count of items written that completes when all the data has been written to the channel writer. @@ -373,7 +373,7 @@ await target /// The input type of the channel. /// The channel to write to. /// The asynchronous source data to use. - /// If true, will call .Complete() if all the results have successfully been written (or the source is emtpy). + /// If true, will call .Complete() if all the results have successfully been written (or the source is empty). /// An optional cancellation token. /// A task containing the count of items written that completes when all the data has been written to the channel writer. /// The count should be ignored if the number of iterations could exceed the max value of long. diff --git a/Open.ChannelExtensions/Extensions.WriteConcurrently.cs b/Open.ChannelExtensions/Extensions.WriteConcurrently.cs index 27809a6..3d69a28 100644 --- a/Open.ChannelExtensions/Extensions.WriteConcurrently.cs +++ b/Open.ChannelExtensions/Extensions.WriteConcurrently.cs @@ -9,7 +9,7 @@ public static partial class Extensions /// The channel to write to. /// The maximum number of concurrent operations. Greater than 1 may likely cause results to be out of order. /// The asynchronous source data to use. - /// If true, will call .Complete() if all the results have successfully been written (or the source is emtpy). + /// If true, will call .Complete() if all the results have successfully been written (or the source is empty). /// An optional cancellation token. /// A task containing the count of items written that completes when all the data has been written to the channel writer. /// The count should be ignored if the number of iterations could exceed the max value of long. @@ -87,7 +87,7 @@ async Task WriteAllAsyncCore() T? value = await e.ConfigureAwait(false); await next.ConfigureAwait(false); count++; - next = target.TryWrite(value) // do this to avoid unneccesary early cancel. + next = target.TryWrite(value) // do this to avoid unnecessary early cancel. ? new ValueTask() : target.WriteAsync(value, cancellationToken); } @@ -131,7 +131,7 @@ static bool TryMoveNextSynchronized( /// The channel to write to. /// The maximum number of concurrent operations. Greater than 1 may likely cause results to be out of order. /// The asynchronous source data to use. - /// If true, will call .Complete() if all the results have successfully been written (or the source is emtpy). + /// If true, will call .Complete() if all the results have successfully been written (or the source is empty). /// An optional cancellation token. /// A task containing the count of items written that completes when all the data has been written to the channel writer. /// The count should be ignored if the number of iterations could exceed the max value of long. @@ -155,7 +155,7 @@ public static Task WriteAllConcurrentlyAsync( /// The channel to write to. /// The maximum number of concurrent operations. Greater than 1 may likely cause results to be out of order. /// The asynchronous source data to use. - /// If true, will call .Complete() if all the results have successfully been written (or the source is emtpy). + /// If true, will call .Complete() if all the results have successfully been written (or the source is empty). /// An optional cancellation token. /// A task containing the count of items written that completes when all the data has been written to the channel writer. /// The count should be ignored if the number of iterations could exceed the max value of long. diff --git a/Open.ChannelExtensions/Extensions._.cs b/Open.ChannelExtensions/Extensions._.cs index 955b2c0..332ee74 100644 --- a/Open.ChannelExtensions/Extensions._.cs +++ b/Open.ChannelExtensions/Extensions._.cs @@ -350,7 +350,7 @@ static async IAsyncEnumerable AsAsyncEnumerableCore(ChannelReader reader, /// Iterates over the results in a Channel. /// Provided as an alternative to .ReadAllAsync() which at the time of publishing this, only exists in .NET Core 3.0 and not .NET Standard 2.1 /// - /// The type recieved by the source channel. + /// The type received by the source channel. /// The outgoing type from the source channel. /// The reader to read from. /// An optional cancellation token that will break out of the iteration.