2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-06-26 21:13:13 +00:00
This commit is contained in:
2021-05-14 18:24:34 +03:00
parent 0af14009be
commit 5bf258673d
48 changed files with 1032 additions and 383 deletions

View File

@ -32,7 +32,7 @@ namespace Esiur.Core
public T GetResult()
{
if (exception != null)
throw exception;
throw exception;
return result;
}

View File

@ -192,7 +192,7 @@ namespace Esiur.Core
// }
}
public void Trigger(object result)
public AsyncReply Trigger(object result)
{
lock (asyncLock)
{
@ -202,7 +202,7 @@ namespace Esiur.Core
Console.WriteLine($"AsyncReply: {Id} Trigger");
if (resultReady)
return;
return this;
this.result = result;
@ -219,14 +219,16 @@ namespace Esiur.Core
Console.WriteLine($"AsyncReply: {Id} Trigger ended");
}
return this;
}
public void TriggerError(Exception exception)
public AsyncReply TriggerError(Exception exception)
{
//timeout?.Dispose();
if (resultReady)
return;
return this;
if (exception is AsyncException)
this.exception = exception as AsyncException;
@ -242,9 +244,10 @@ namespace Esiur.Core
mutex?.Set();
return this;
}
public void TriggerProgress(ProgressType type, int value, int max)
public AsyncReply TriggerProgress(ProgressType type, int value, int max)
{
//timeout?.Dispose();
@ -254,10 +257,12 @@ namespace Esiur.Core
cb(type, value, max);
//}
return this;
}
public void TriggerChunk(object value)
public AsyncReply TriggerChunk(object value)
{
//timeout?.Dispose();
@ -269,6 +274,8 @@ namespace Esiur.Core
cb(value);
//}
return this;
}
public AsyncAwaiter GetAwaiter()

View File

@ -36,6 +36,10 @@ namespace Esiur.Core
SetPropertyDenied,
ReadOnlyProperty,
GeneralFailure,
AddToStoreFailed
AddToStoreFailed,
NotAttached,
AlreadyListened,
AlreadyUnlistened,
NotListenable
}
}