Fix build failures with new VS (#10411)
This commit is contained in:
parent
55555bedd5
commit
663c83c140
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Channels;
|
||||
using System.Threading.Tasks;
|
||||
|
|
@ -23,7 +24,7 @@ namespace Microsoft.AspNetCore.SignalR.Internal
|
|||
return new CancelableTypedAsyncEnumerable<T>(asyncEnumerable, cts);
|
||||
}
|
||||
|
||||
public static async IAsyncEnumerable<object> MakeAsyncEnumerableFromChannel<T>(ChannelReader<T> channel, CancellationToken cancellationToken = default)
|
||||
public static async IAsyncEnumerable<object> MakeAsyncEnumerableFromChannel<T>(ChannelReader<T> channel, [EnumeratorCancellation] CancellationToken cancellationToken = default)
|
||||
{
|
||||
await foreach (var item in channel.ReadAllAsync(cancellationToken))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Channels;
|
||||
|
|
@ -851,7 +852,7 @@ namespace Microsoft.AspNetCore.SignalR.Tests
|
|||
return channel.Reader;
|
||||
}
|
||||
|
||||
public async IAsyncEnumerable<int> CancelableStreamGeneratedAsyncEnumerable(CancellationToken token)
|
||||
public async IAsyncEnumerable<int> CancelableStreamGeneratedAsyncEnumerable([EnumeratorCancellation] CancellationToken token)
|
||||
{
|
||||
_tcsService.StartedMethod.SetResult(null);
|
||||
await token.WaitForCancellationAsync();
|
||||
|
|
|
|||
Loading…
Reference in New Issue