// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
// =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
//
//
//
// Interfaces used to represent instances that notify listeners of their completion via continuations.
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
using System;
using System.Security;
namespace System.Runtime.CompilerServices
{
///
/// Represents an operation that will schedule continuations when the operation completes.
///
public interface INotifyCompletion
{
/// Schedules the continuation action to be invoked when the instance completes.
/// The action to invoke when the operation completes.
/// The argument is null (Nothing in Visual Basic).
void OnCompleted(Action continuation);
}
///
/// Represents an awaiter used to schedule continuations when an await operation completes.
///
public interface ICriticalNotifyCompletion : INotifyCompletion
{
/// Schedules the continuation action to be invoked when the instance completes.
/// The action to invoke when the operation completes.
/// The argument is null (Nothing in Visual Basic).
/// Unlike OnCompleted, UnsafeOnCompleted need not propagate ExecutionContext information.
void UnsafeOnCompleted(Action continuation);
}
}