Skip to content

Commit

Permalink
Adding awaiter abstractions.
Browse files Browse the repository at this point in the history
  • Loading branch information
bartdesmet committed Sep 21, 2017
1 parent 9cac137 commit 51ee34a
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
16 changes: 16 additions & 0 deletions AsyncRx.NET/System.Reactive.Bcl/System/IAwaitable.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.

namespace System
{
public interface IAwaitable
{
IAwaiter GetAwaiter();
}

public interface IAwaitable<T>
{
IAwaiter<T> GetAwaiter();
}
}
20 changes: 20 additions & 0 deletions AsyncRx.NET/System.Reactive.Bcl/System/IAwaiter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.

using System.Runtime.CompilerServices;

namespace System
{
public interface IAwaiter : INotifyCompletion
{
bool IsCompleted { get; }
void GetResult();
}

public interface IAwaiter<T> : INotifyCompletion
{
bool IsCompleted { get; }
T GetResult();
}
}

0 comments on commit 51ee34a

Please sign in to comment.