Exemplo n.º 1
0
 public TResult Call <TResult>(RecursiveCallResult <TResult> result)
 {
     if (_context != RecursiveCallContext.Context)
     {
         throw new InvalidOperationException("context mismatch");
     }
     result.IsOwnerOfCtx = true;
     if (result.IsCompleted)
     {
         return(result.GetAwaiter().GetResult());
     }
     foreach (var action in _context.WillDoAction.GetConsumingEnumerable())
     {
         action();
     }
     return(result.GetAwaiter().GetResult());
 }
Exemplo n.º 2
0
 internal RecursiveCallResult(RecursiveCallResult <VoidStruct> @base)
 {
     Base = @base;
 }
Exemplo n.º 3
0
 public void Call(RecursiveCallResult result)
 {
     Call(result.Base);
 }
 // ReSharper disable once UnusedParameter.Local
 private RecursiveCallResultBuilder(int _)
 {
     Task = new RecursiveCallResult <TResult>();
 }
 internal RecursiveCallResultAwaiter(RecursiveCallResult <TResult> result)
 {
     _result = result;
 }