Fix build failures with new VS (#10411)

This commit is contained in:
BrennanConroy 2019-05-20 17:51:06 -07:00 committed by GitHub
parent 55555bedd5
commit 663c83c140
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -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))
{

View File

@ -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();