mirror of https://github.com/ogoun/Zero.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
530 B
22 lines
530 B
using System.Threading.Tasks;
|
|
|
|
namespace ZeroLevel.Services.Async.Internal
|
|
{
|
|
/// <summary>
|
|
/// Represents an abstract item awaiter.
|
|
/// </summary>
|
|
internal interface IAwaiter<T>
|
|
{
|
|
/// <summary>
|
|
/// <para>Attempts to complete the awaiter with a specified result.</para>
|
|
/// <para>Returns false if the awaiter has been canceled.</para>
|
|
/// </summary>
|
|
bool TrySetResult(T result);
|
|
|
|
/// <summary>
|
|
/// The task that's completed when the awaiter gets the result.
|
|
/// </summary>
|
|
ValueTask<T> Task { get; }
|
|
}
|
|
}
|