using System; using System.Threading.Tasks; using Wabbajack.Common; namespace Wabbajack.Lib { /// /// Wabbajack runs mostly as a batch processor of sorts, we have a list of tasks we need to perform /// and the Compilers/Installers run throught those tasks one at a time. At any given moment the processor /// will be using multiple threads to complete that task. This interface defines a common implementation of /// all reporting functionality of both the compilers and installers. /// /// These processors are disposible because they contain WorkQueues which must be properly shutdown to keep /// from leaking threads. /// public interface IBatchProcessor : IDisposable { /// /// The current progress of the entire processing system on a scale of 0.0 to 1.0 /// IObservable PercentCompleted { get; } /// /// The current status of the processor as a text string /// IObservable TextStatus { get; } /// /// The status of the processor's work queue /// IObservable QueueStatus { get; } IObservable IsRunning { get; } /// /// Begin processing /// Task Begin(); /// /// Terminate any processing currently in progress by the processor. The processor should be disposed of /// after calling this function as processing cannot be resumed and the tasks may be half completed. /// Should only be called while IsRunning = true; /// void Terminate(); } }