Aetheria/Assets/Scripts/NIH/MagicOnion/Utils/TaskCompletionSourceEx.cs
hyperion51 c58ba0b1da Copy Aetheria Code
Added a bunch of code from the old Aetheria project
2020-02-27 18:51:07 +00:00

24 lines
No EOL
538 B
C#

using System;
using System.Threading.Tasks;
namespace MagicOnion.Utils
{
internal interface ITaskCompletion
{
bool TrySetException(Exception ex);
bool TrySetCanceled();
}
internal class TaskCompletionSourceEx<T> : TaskCompletionSource<T>, ITaskCompletion
{
bool ITaskCompletion.TrySetCanceled()
{
return this.TrySetCanceled();
}
bool ITaskCompletion.TrySetException(Exception ex)
{
return this.TrySetException(ex);
}
}
}