using System; using System.Collections.Generic; using Duplicati.Library.Utility; using Duplicati.Server; using Duplicati.Server.Serialization.Interface; namespace Duplicati.WebserverCore.Abstractions; public interface IScheduler { /// /// Initializes scheduler /// /// The worker thread void Init(WorkerThread worker); IList> GetSchedulerQueueIds(); /// /// Terminates the thread. Any items still in queue will be removed /// /// True if the call should block until the thread has exited, false otherwise void Terminate(bool wait); /// /// Subscribes to the event that is triggered when the schedule changes /// void SubScribeToNewSchedule(Action handler); /// /// A snapshot copy of the current schedule list /// List> Schedule { get; } /// /// A snapshot copy of the current worker queue, that is items that are scheduled, but waiting for execution /// List WorkerQueue { get; } /// /// Forces the scheduler to re-evaluate the order. /// Call this method if something changes /// void Reschedule(); }