mirror of
https://github.com/FabInfra/capnproto-dotnetcore_Runtime.git
synced 2025-03-13 07:11:44 +01:00
Troubleshooting
This commit is contained in:
parent
77467e606a
commit
eb1f22902b
@ -45,8 +45,19 @@ namespace Capnp.Rpc
|
|||||||
if (rtask.IsCompleted)
|
if (rtask.IsCompleted)
|
||||||
{
|
{
|
||||||
// Force .NET to create a new Task instance
|
// Force .NET to create a new Task instance
|
||||||
var stask = rtask;
|
if (rtask.IsCanceled)
|
||||||
rtask = new Task<T>(() => stask.Result);
|
{
|
||||||
|
rtask = Task.FromCanceled<T>(new CancellationToken(true));
|
||||||
|
}
|
||||||
|
else if (rtask.IsFaulted)
|
||||||
|
{
|
||||||
|
rtask = Task.FromException<T>(rtask.Exception.InnerException);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
rtask = Task.FromResult<T>(rtask.Result);
|
||||||
|
}
|
||||||
|
|
||||||
_taskTable.Add(rtask, promise);
|
_taskTable.Add(rtask, promise);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user