Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .claude/settings.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
"Bash(timeout 30 dotnet test --no-build --verbosity minimal)",
"Bash(git log:*)",
"Bash(git log:*)",
"Bash(dotnet clean:*)"
"Bash(dotnet clean:*)",
"Bash(del:*)",
"Bash(git pull:*)"
],
"deny": []
}
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -348,3 +348,6 @@ MigrationBackup/

# Ionide (cross platform F# VS Code tools) working folder
.ionide/

# Claude local settings
.claude/settings.local.json
237 changes: 0 additions & 237 deletions EnumerableAsyncProcessor.Example/ChannelProcessingExamples.cs

This file was deleted.

3 changes: 0 additions & 3 deletions EnumerableAsyncProcessor.Example/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ Task<HttpResponseMessage> PingAsync()
}

#if NET6_0_OR_GREATER
// Run channel processing examples
await ChannelProcessingExamples.RunAllExamples();

// Run IAsyncEnumerable examples
Console.WriteLine("\n\n=== Running IAsyncEnumerable Examples ===\n");
await AsyncEnumerableExample.RunExamples();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,80 +142,6 @@ public async Task SelectAsync_ProcessInParallel_WithHighConcurrency_HandlesCorre
await Assert.That(results.OrderBy(x => x)).IsEquivalentTo(Enumerable.Range(1, 50).Select(x => x * 3));
}

[Test]
public async Task ForEachAsync_ProcessWithChannel_ProcessesAllItems()
{
var processedItems = new List<int>();
var asyncEnumerable = GenerateAsyncEnumerable(30);

await asyncEnumerable
.ForEachAsync(async item =>
{
await Task.Delay(5);
lock (processedItems)
{
processedItems.Add(item);
}
})
.ProcessWithChannel(new AsyncEnumerableChannelOptions
{
BufferSize = 10,
MaxConcurrency = 5
})
.ExecuteAsync();

await Assert.That(processedItems.Count).IsEqualTo(30);
await Assert.That(processedItems.OrderBy(x => x)).IsEquivalentTo(Enumerable.Range(1, 30));
}

[Test]
public async Task SelectAsync_ProcessWithChannel_WithOrderPreservation_MaintainsOrder()
{
var asyncEnumerable = GenerateAsyncEnumerable(20);
var random = new Random(42);

var results = await asyncEnumerable
.SelectAsync(async item =>
{
// Random delay to test order preservation
await Task.Delay(random.Next(1, 20));
return item * 2;
})
.ProcessWithChannel(new AsyncEnumerableChannelOptions
{
BufferSize = 5,
MaxConcurrency = 4,
PreserveOrder = true
})
.ExecuteAsync()
.ToListAsync();

await Assert.That(results.Count).IsEqualTo(20);
await Assert.That(results).IsEquivalentTo(Enumerable.Range(1, 20).Select(x => x * 2));
}

[Test]
public async Task SelectAsync_ProcessWithChannel_WithoutOrderPreservation_ReturnsAllItems()
{
var asyncEnumerable = GenerateAsyncEnumerable(20);

var results = await asyncEnumerable
.SelectAsync(async item =>
{
await Task.Delay(5);
return item * 2;
})
.ProcessWithChannel(new AsyncEnumerableChannelOptions
{
PreserveOrder = false,
MaxConcurrency = 4
})
.ExecuteAsync()
.ToListAsync();

await Assert.That(results.Count).IsEqualTo(20);
await Assert.That(results.OrderBy(x => x)).IsEquivalentTo(Enumerable.Range(1, 20).Select(x => x * 2));
}

[Test]
public async Task ForEachAsync_WithCancellation_StopsProcessing()
Expand Down
Loading