Catalog/imagecatalog/Services/IImageProcessingCoordinator.cs

28 lines
786 B
C#
Raw Permalink Normal View History

using System;
using System.Threading;
using System.Threading.Tasks;
using MaddoShared;
namespace ImageCatalog_2.Services
{
public readonly record struct ImageProcessedUpdate(string Status, int Total, int Processed);
public sealed class ImageProcessingRunRequest
{
public required ImageCreationService.Options Options { get; init; }
}
public sealed class ImageProcessingRunResult
{
public required string FinalSpeedCounter { get; init; }
}
public interface IImageProcessingCoordinator
{
Task<ImageProcessingRunResult> RunAsync(
ImageProcessingRunRequest request,
CancellationToken token,
Action<ImageProcessedUpdate> onImageProcessed,
Action<string> onSpeedUpdated);
}
}