You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is to allow the scheduler to ensure you're within an expected
execution context, without needing to force a yield if you're already
in the expected or desired context
This includes major refactoring to collapse the implementation into Scheduler
for simplicity. Added unit tests to check behavior of Marshal() and Yield()
with respect to threads and the sync context
Copy file name to clipboardExpand all lines: src/CoroutineScheduler.Core/IScheduler.cs
+6-1Lines changed: 6 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,12 @@ public interface IScheduler
23
23
/// </summary>
24
24
/// <returns>An awaitable whose awaiter completes at the mercy of this scheduler.</returns>
25
25
YieldTaskYield();
26
+
27
+
/// <summary>
28
+
/// Marshal to this scheduler.<br/>
29
+
/// </summary>
30
+
/// <returns>An awaitable whose awaiter completes at the mercy of this scheduler for the purposes of marshalling in some way, such as between threads.</returns>
31
+
YieldTaskMarshal();
26
32
}
27
33
28
34
/// <summary>
@@ -36,7 +42,6 @@ public record struct YieldTask
36
42
/// <summary>
37
43
/// A struct container to provide the compiler duck-typeing so an <see cref="IYieldAwaiter"/> can be <c>await</c>ed.
0 commit comments