2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-06-26 21:13:13 +00:00

added Wait

This commit is contained in:
2019-12-31 12:56:06 +03:00
parent 3375a814e6
commit ed34ae229d
4 changed files with 14 additions and 2 deletions

View File

@ -51,6 +51,11 @@ namespace Esyur.Core
return new AsyncAwaiter<object[]>(this); return new AsyncAwaiter<object[]>(this);
} }
public new object[] Wait()
{
return (object[])base.Wait();
}
public void Seal() public void Seal()
{ {

View File

@ -56,6 +56,11 @@ namespace Esyur.Core
return new AsyncAwaiter<T[]>(this); return new AsyncAwaiter<T[]>(this);
} }
public new T[] Wait()
{
return base.Wait().Select(x => (T)x).ToArray();
}
public AsyncBag() public AsyncBag()
{ {

View File

@ -72,7 +72,6 @@ namespace Esyur.Core
public object Wait() public object Wait()
{ {
if (resultReady) if (resultReady)
return result; return result;

View File

@ -75,7 +75,10 @@ namespace Esyur.Core
return new AsyncAwaiter<T>(this); return new AsyncAwaiter<T>(this);
} }
public new T Wait()
{
return (T)base.Wait();
}
/* /*
protected new List<Action> callbacks = new List<Action>(); protected new List<Action> callbacks = new List<Action>();
protected new object result; protected new object result;