mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2025-06-27 05:23:13 +00:00
<>
This commit is contained in:
@ -1,12 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Esiur.Core
|
||||
{
|
||||
// This interface is used to provide return type for templates and support chunk callbacks using IAsyncEnumerable feature of C# 8
|
||||
public interface IAsyncChunk<T> : IAsyncEnumerable<object>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -9,13 +9,22 @@ namespace Esiur.Core
|
||||
{
|
||||
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) {
|
||||
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; }
|
||||
|
Reference in New Issue
Block a user