Skip to content

Commit 0c5586d

Browse files
Add Copilot instructions and update version to 9.1.3
1 parent 150c616 commit 0c5586d

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

.github/copilot-instructions.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copilot Instructions
2+
3+
## General Guidelines
4+
- Prefer keeping `TaskScheduler.Current` in `BufferingChannelReader` completion continuation; changing to `TaskScheduler.Default` breaks intended behavior.

Open.ChannelExtensions/Open.ChannelExtensions.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<RepositoryType>git</RepositoryType>
2323
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
2424
<GenerateDocumentationFile>true</GenerateDocumentationFile>
25-
<Version>9.1.2</Version>
25+
<Version>9.1.3</Version>
2626
<PackageReleaseNotes>Ensure the current task scheduler is used and that it can be configured.</PackageReleaseNotes>
2727
<PackageLicenseExpression>MIT</PackageLicenseExpression>
2828
<PublishRepositoryUrl>true</PublishRepositoryUrl>

Open.ChannelExtensions/Readers/BatchingChannelReader.cs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -245,22 +245,13 @@ protected override async ValueTask<bool> WaitToReadAsyncCore(
245245
}
246246

247247
// WhenAny will not throw when a task is cancelled.
248-
Task<bool> sTask = s.AsTask();
249-
await Task.WhenAny(sTask, b).ConfigureAwait(false);
248+
await Task.WhenAny(s.AsTask(), b).ConfigureAwait(false);
250249
if (b.IsCompleted) // Assuming it was bufferWait that completed.
251250
{
252251
await tokenSource.CancelAsync().ConfigureAwait(false);
253252
return await b.ConfigureAwait(false);
254253
}
255254

256-
// Await the source task to check if it completed and get its result
257-
// This prevents a tight loop when the source is closed
258-
await sTask.ConfigureAwait(false);
259-
// Check if buffer completed while we were waiting (e.g., timeout forced a batch)
260-
// If so, return immediately without trying to pipe more items
261-
if (b.IsCompleted)
262-
return await b.ConfigureAwait(false);
263-
264255
TryPipeItems(false);
265256

266257
if (b.IsCompleted || token.IsCancellationRequested)

0 commit comments

Comments
 (0)