ResourceInvoker faster task completion check
This commit is contained in:
parent
763720b092
commit
7a4400e3b2
|
|
@ -207,7 +207,7 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure
|
||||||
filter);
|
filter);
|
||||||
|
|
||||||
var task = filter.OnAuthorizationAsync(authorizationContext);
|
var task = filter.OnAuthorizationAsync(authorizationContext);
|
||||||
if (task.Status != TaskStatus.RanToCompletion)
|
if (!task.IsCompletedSuccessfully)
|
||||||
{
|
{
|
||||||
next = State.AuthorizationAsyncEnd;
|
next = State.AuthorizationAsyncEnd;
|
||||||
return task;
|
return task;
|
||||||
|
|
@ -344,7 +344,7 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure
|
||||||
filter);
|
filter);
|
||||||
|
|
||||||
var task = filter.OnResourceExecutionAsync(resourceExecutingContext, InvokeNextResourceFilterAwaitedAsync);
|
var task = filter.OnResourceExecutionAsync(resourceExecutingContext, InvokeNextResourceFilterAwaitedAsync);
|
||||||
if (task.Status != TaskStatus.RanToCompletion)
|
if (!task.IsCompletedSuccessfully)
|
||||||
{
|
{
|
||||||
next = State.ResourceAsyncEnd;
|
next = State.ResourceAsyncEnd;
|
||||||
return task;
|
return task;
|
||||||
|
|
@ -418,7 +418,7 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure
|
||||||
}
|
}
|
||||||
|
|
||||||
var task = InvokeNextResourceFilter();
|
var task = InvokeNextResourceFilter();
|
||||||
if (task.Status != TaskStatus.RanToCompletion)
|
if (!task.IsCompletedSuccessfully)
|
||||||
{
|
{
|
||||||
next = State.ResourceSyncEnd;
|
next = State.ResourceSyncEnd;
|
||||||
return task;
|
return task;
|
||||||
|
|
@ -463,7 +463,7 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure
|
||||||
|
|
||||||
_result = _resourceExecutingContext.Result;
|
_result = _resourceExecutingContext.Result;
|
||||||
var task = InvokeAlwaysRunResultFilters();
|
var task = InvokeAlwaysRunResultFilters();
|
||||||
if (task.Status != TaskStatus.RanToCompletion)
|
if (!task.IsCompletedSuccessfully)
|
||||||
{
|
{
|
||||||
next = State.ResourceEnd;
|
next = State.ResourceEnd;
|
||||||
return task;
|
return task;
|
||||||
|
|
@ -512,7 +512,7 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure
|
||||||
case State.ExceptionAsyncBegin:
|
case State.ExceptionAsyncBegin:
|
||||||
{
|
{
|
||||||
var task = InvokeNextExceptionFilterAsync();
|
var task = InvokeNextExceptionFilterAsync();
|
||||||
if (task.Status != TaskStatus.RanToCompletion)
|
if (!task.IsCompletedSuccessfully)
|
||||||
{
|
{
|
||||||
next = State.ExceptionAsyncResume;
|
next = State.ExceptionAsyncResume;
|
||||||
return task;
|
return task;
|
||||||
|
|
@ -539,7 +539,7 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure
|
||||||
filter);
|
filter);
|
||||||
|
|
||||||
var task = filter.OnExceptionAsync(exceptionContext);
|
var task = filter.OnExceptionAsync(exceptionContext);
|
||||||
if (task.Status != TaskStatus.RanToCompletion)
|
if (!task.IsCompletedSuccessfully)
|
||||||
{
|
{
|
||||||
next = State.ExceptionAsyncEnd;
|
next = State.ExceptionAsyncEnd;
|
||||||
return task;
|
return task;
|
||||||
|
|
@ -579,7 +579,7 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure
|
||||||
case State.ExceptionSyncBegin:
|
case State.ExceptionSyncBegin:
|
||||||
{
|
{
|
||||||
var task = InvokeNextExceptionFilterAsync();
|
var task = InvokeNextExceptionFilterAsync();
|
||||||
if (task.Status != TaskStatus.RanToCompletion)
|
if (!task.IsCompletedSuccessfully)
|
||||||
{
|
{
|
||||||
next = State.ExceptionSyncEnd;
|
next = State.ExceptionSyncEnd;
|
||||||
return task;
|
return task;
|
||||||
|
|
@ -650,7 +650,7 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure
|
||||||
_result = _exceptionContext.Result;
|
_result = _exceptionContext.Result;
|
||||||
|
|
||||||
var task = InvokeAlwaysRunResultFilters();
|
var task = InvokeAlwaysRunResultFilters();
|
||||||
if (task.Status != TaskStatus.RanToCompletion)
|
if (!task.IsCompletedSuccessfully)
|
||||||
{
|
{
|
||||||
next = State.ResourceInsideEnd;
|
next = State.ResourceInsideEnd;
|
||||||
return task;
|
return task;
|
||||||
|
|
@ -683,7 +683,7 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure
|
||||||
}
|
}
|
||||||
|
|
||||||
var task = InvokeResultFilters();
|
var task = InvokeResultFilters();
|
||||||
if (task.Status != TaskStatus.RanToCompletion)
|
if (!task.IsCompletedSuccessfully)
|
||||||
{
|
{
|
||||||
next = State.ResourceInsideEnd;
|
next = State.ResourceInsideEnd;
|
||||||
return task;
|
return task;
|
||||||
|
|
@ -694,7 +694,7 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure
|
||||||
case State.ActionBegin:
|
case State.ActionBegin:
|
||||||
{
|
{
|
||||||
var task = InvokeInnerFilterAsync();
|
var task = InvokeInnerFilterAsync();
|
||||||
if (task.Status != TaskStatus.RanToCompletion)
|
if (!task.IsCompletedSuccessfully)
|
||||||
{
|
{
|
||||||
next = State.ActionEnd;
|
next = State.ActionEnd;
|
||||||
return task;
|
return task;
|
||||||
|
|
@ -715,7 +715,7 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure
|
||||||
|
|
||||||
Debug.Assert(scope == Scope.Invoker || scope == Scope.Resource);
|
Debug.Assert(scope == Scope.Invoker || scope == Scope.Resource);
|
||||||
var task = InvokeResultFilters();
|
var task = InvokeResultFilters();
|
||||||
if (task.Status != TaskStatus.RanToCompletion)
|
if (!task.IsCompletedSuccessfully)
|
||||||
{
|
{
|
||||||
next = State.ResourceInsideEnd;
|
next = State.ResourceInsideEnd;
|
||||||
return task;
|
return task;
|
||||||
|
|
@ -916,7 +916,7 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure
|
||||||
filter);
|
filter);
|
||||||
|
|
||||||
var task = filter.OnResultExecutionAsync(resultExecutingContext, InvokeNextResultFilterAwaitedAsync<TFilter, TFilterAsync>);
|
var task = filter.OnResultExecutionAsync(resultExecutingContext, InvokeNextResultFilterAwaitedAsync<TFilter, TFilterAsync>);
|
||||||
if (task.Status != TaskStatus.RanToCompletion)
|
if (!task.IsCompletedSuccessfully)
|
||||||
{
|
{
|
||||||
next = State.ResultAsyncEnd;
|
next = State.ResultAsyncEnd;
|
||||||
return task;
|
return task;
|
||||||
|
|
@ -998,7 +998,7 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure
|
||||||
}
|
}
|
||||||
|
|
||||||
var task = InvokeNextResultFilterAsync<TFilter, TFilterAsync>();
|
var task = InvokeNextResultFilterAsync<TFilter, TFilterAsync>();
|
||||||
if (task.Status != TaskStatus.RanToCompletion)
|
if (!task.IsCompletedSuccessfully)
|
||||||
{
|
{
|
||||||
next = State.ResultSyncEnd;
|
next = State.ResultSyncEnd;
|
||||||
return task;
|
return task;
|
||||||
|
|
@ -1048,7 +1048,7 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure
|
||||||
}
|
}
|
||||||
|
|
||||||
var task = InvokeResultAsync(_result);
|
var task = InvokeResultAsync(_result);
|
||||||
if (task.Status != TaskStatus.RanToCompletion)
|
if (!task.IsCompletedSuccessfully)
|
||||||
{
|
{
|
||||||
next = State.ResultEnd;
|
next = State.ResultEnd;
|
||||||
return task;
|
return task;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue