diff options
Diffstat (limited to 'src/mscorlib/shared/System/Runtime/CompilerServices/INotifyCompletion.cs')
-rw-r--r-- | src/mscorlib/shared/System/Runtime/CompilerServices/INotifyCompletion.cs | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/mscorlib/shared/System/Runtime/CompilerServices/INotifyCompletion.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/INotifyCompletion.cs new file mode 100644 index 0000000000..aba0a0691f --- /dev/null +++ b/src/mscorlib/shared/System/Runtime/CompilerServices/INotifyCompletion.cs @@ -0,0 +1,39 @@ +// 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 +{ + /// <summary> + /// Represents an operation that will schedule continuations when the operation completes. + /// </summary> + public interface INotifyCompletion + { + /// <summary>Schedules the continuation action to be invoked when the instance completes.</summary> + /// <param name="continuation">The action to invoke when the operation completes.</param> + /// <exception cref="System.ArgumentNullException">The <paramref name="continuation"/> argument is null (Nothing in Visual Basic).</exception> + void OnCompleted(Action continuation); + } + + /// <summary> + /// Represents an awaiter used to schedule continuations when an await operation completes. + /// </summary> + public interface ICriticalNotifyCompletion : INotifyCompletion + { + /// <summary>Schedules the continuation action to be invoked when the instance completes.</summary> + /// <param name="continuation">The action to invoke when the operation completes.</param> + /// <exception cref="System.ArgumentNullException">The <paramref name="continuation"/> argument is null (Nothing in Visual Basic).</exception> + /// <remarks>Unlike OnCompleted, UnsafeOnCompleted need not propagate ExecutionContext information.</remarks> + void UnsafeOnCompleted(Action continuation); + } +} |