dotnet-core/release-notes/2.1/Preview/api-diff/preview2/2.1-preview2_System.Threading.Tasks.Sources.md
2018-04-10 17:24:20 -07:00

923 B

System.Threading.Tasks.Sources

+namespace System.Threading.Tasks.Sources {
+    public interface IValueTaskSource {
+        void GetResult(short token);
+        ValueTaskSourceStatus GetStatus(short token);
+        void OnCompleted(Action<object> continuation, object state, short token, ValueTaskSourceOnCompletedFlags flags);
+    }
+    public interface IValueTaskSource<out TResult> {
+        TResult GetResult(short token);
+        ValueTaskSourceStatus GetStatus(short token);
+        void OnCompleted(Action<object> continuation, object state, short token, ValueTaskSourceOnCompletedFlags flags);
+    }
+    public enum ValueTaskSourceOnCompletedFlags {
+        FlowExecutionContext = 2,
+        None = 0,
+        UseSchedulingContext = 1,
+    }
+    public enum ValueTaskSourceStatus {
+        Canceled = 3,
+        Faulted = 2,
+        Pending = 0,
+        Succeeded = 1,
+    }
+}