From 86767a7021a7098f4d867377ba7d28f1298a5037 Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Wed, 5 Dec 2018 21:47:34 -0500 Subject: [PATCH] Add CancellationToken parameter to GetAsyncEnumerator --- .../shared/System/Collections/Generic/IAsyncEnumerable.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/System.Private.CoreLib/shared/System/Collections/Generic/IAsyncEnumerable.cs b/src/System.Private.CoreLib/shared/System/Collections/Generic/IAsyncEnumerable.cs index ef0207015142..302b96485506 100644 --- a/src/System.Private.CoreLib/shared/System/Collections/Generic/IAsyncEnumerable.cs +++ b/src/System.Private.CoreLib/shared/System/Collections/Generic/IAsyncEnumerable.cs @@ -2,6 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System.Threading; + namespace System.Collections.Generic { /// Exposes an enumerator that provides asynchronous iteration over values of a specified type. @@ -9,7 +11,8 @@ namespace System.Collections.Generic public interface IAsyncEnumerable { /// Returns an enumerator that iterates asynchronously through the collection. + /// A that may be used to cancel the asynchronous iteration. /// An enumerator that can be used to iterate asynchronously through the collection. - IAsyncEnumerator GetAsyncEnumerator(); + IAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default); } }