Skip to content

Commit ba841d9

Browse files
committed
Move to partial standard IAsyncEnumerator API
1 parent 75e57c6 commit ba841d9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+66
-41
lines changed

async-enumerable-dotnet-test/TestHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public static ValueTask AssertResult<T>(this async_enumerable_dotnet.IAsyncEnume
2222
}
2323

2424
// ReSharper disable once ParameterOnlyUsedForPreconditionCheck.Global
25-
public static async ValueTask AssertResult<T>(this async_enumerable_dotnet.IAsyncEnumerator<T> source, params T[] values)
25+
public static async ValueTask AssertResult<T>(this IAsyncEnumerator<T> source, params T[] values)
2626
{
2727
var main = default(Exception);
2828
var dispose = default(Exception);
@@ -127,7 +127,7 @@ public static ValueTask AssertFailure<T>(this async_enumerable_dotnet.IAsyncEnum
127127
}
128128

129129
// ReSharper disable once ParameterOnlyUsedForPreconditionCheck.Global
130-
public static async ValueTask AssertFailure<T>(this async_enumerable_dotnet.IAsyncEnumerator<T> source, Type exception,
130+
public static async ValueTask AssertFailure<T>(this IAsyncEnumerator<T> source, Type exception,
131131
params T[] values)
132132
{
133133
var idx = 0;

async-enumerable-dotnet/AsyncEnumerableAPI.cs

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,10 @@
22
// Licensed under the Apache 2.0 License.
33
// See LICENSE file in the project root for full license information.
44

5-
using System.Threading.Tasks;
5+
using System.Collections.Generic;
66

77
namespace async_enumerable_dotnet
88
{
9-
/// <summary>
10-
/// Until C# 8: Dispose a resource or sequence asynchronously in an awaitable fashion.
11-
/// </summary>
12-
public interface IAsyncDisposable
13-
{
14-
/// <summary>
15-
/// Dispose a resource or sequence asynchronously.
16-
/// </summary>
17-
/// <returns>The task completed when the dispose action completes.</returns>
18-
ValueTask DisposeAsync();
19-
}
20-
21-
/// <summary>
22-
/// Until C# 8: Represents an active asynchronous sequence which can be polled for more items.
23-
/// </summary>
24-
/// <typeparam name="T">The element type of the async sequence.</typeparam>
25-
/// <remarks>
26-
/// The <see cref="IAsyncDisposable.DisposeAsync"/> should be called exactly once and
27-
/// only after an outstanding <see cref="MoveNextAsync"/>'s task completed.
28-
/// </remarks>
29-
public interface IAsyncEnumerator<out T> : IAsyncDisposable
30-
{
31-
/// <summary>
32-
/// Request the next element from the async sequence.
33-
/// </summary>
34-
/// <returns>A task that returns true if the next item can be read via
35-
/// <see cref="Current"/>, false if there will be no further items.</returns>
36-
ValueTask<bool> MoveNextAsync();
37-
38-
/// <summary>
39-
/// Returns the current item after a successful <see cref="MoveNextAsync"/> call.
40-
/// </summary>
41-
T Current { get; }
42-
}
43-
449
/// <summary>
4510
/// Until C# 8: Represents a deferred/lazy asynchronous sequence of values.
4611
/// </summary>

async-enumerable-dotnet/MulticastAsyncEnumerable.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System;
77
using System.Threading;
88
using System.Threading.Tasks;
9+
using System.Collections.Generic;
910

1011
namespace async_enumerable_dotnet
1112
{

async-enumerable-dotnet/UnicastAsyncEnumerable.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using System.Collections.Concurrent;
88
using System.Threading;
99
using System.Threading.Tasks;
10+
using System.Collections.Generic;
1011

1112
namespace async_enumerable_dotnet
1213
{

async-enumerable-dotnet/async-enumerable-dotnet.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
</PropertyGroup>
2424

2525
<ItemGroup>
26-
<!-- ... -->
26+
<!--
2727
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.3" Condition="'$(TargetFramework)' == 'netstandard2.0'" />
28-
<!-- ... -->
28+
-->
2929
</ItemGroup>
3030
</Project>

async-enumerable-dotnet/impl/All.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
using System;
66
using System.Threading.Tasks;
7+
using System.Collections.Generic;
78

89
namespace async_enumerable_dotnet.impl
910
{

async-enumerable-dotnet/impl/Amb.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System;
66
using System.Threading;
77
using System.Threading.Tasks;
8+
using System.Collections.Generic;
89

910
namespace async_enumerable_dotnet.impl
1011
{

async-enumerable-dotnet/impl/Any.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
using System;
66
using System.Threading.Tasks;
7+
using System.Collections.Generic;
78

89
namespace async_enumerable_dotnet.impl
910
{

async-enumerable-dotnet/impl/Collect.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
using System;
66
using System.Threading.Tasks;
7+
using System.Collections.Generic;
78

89
namespace async_enumerable_dotnet.impl
910
{

async-enumerable-dotnet/impl/CombineLatest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.Collections.Concurrent;
77
using System.Threading;
88
using System.Threading.Tasks;
9+
using System.Collections.Generic;
910

1011
namespace async_enumerable_dotnet.impl
1112
{

0 commit comments

Comments
 (0)