2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-05-06 11:32:59 +00:00
esiur-dotnet/Esiur/Core/InvocationContext.cs
2024-12-07 02:56:49 +03:00

41 lines
890 B
C#

using Esiur.Net.IIP;
using System;
using System.Collections.Generic;
using System.Text;
namespace Esiur.Core
{
public class InvocationContext
{
private uint CallbackId;
internal bool Ended;
public void Chunk(object value)
{
if (Ended)
throw new Exception("Execution has ended.");
Connection.SendChunk(CallbackId, value);
}
public void Progress(int value, int max) {
if (Ended)
throw new Exception("Execution has ended.");
Connection.SendProgress(CallbackId, value, max);
}
public DistributedConnection Connection { get; internal set; }
internal InvocationContext(DistributedConnection connection, uint callbackId)
{
Connection = connection;
CallbackId = callbackId;
}
}
}