// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. using System.Reactive.Disposables; namespace System.Reactive.Concurrency { /// /// Scheduler with support for running periodic tasks. /// This type of scheduler can be used to run timers more efficiently instead of using recursive scheduling. /// public interface ISchedulerPeriodic { /// /// Schedules a periodic piece of work. /// /// The type of the state passed to the scheduled action. /// Initial state passed to the action upon the first iteration. /// Period for running the work periodically. /// Action to be executed, potentially updating the state. /// The disposable object used to cancel the scheduled recurring action (best effort). IDisposable SchedulePeriodic(TState state, TimeSpan period, Func action); } }