Unosquare
    Show / Hide Table of Contents

    Class PeriodicTask

    Schedule an action to be periodically executed on the thread pool.

    Inheritance
    Object
    PeriodicTask
    Namespace: Swan.Threading
    Syntax
    public sealed class PeriodicTask : IDisposable

    Constructors

    PeriodicTask(TimeSpan, Func<CancellationToken, Task>, CancellationToken)

    Initializes a new instance of the PeriodicTask class.

    Declaration
    public PeriodicTask(TimeSpan interval, Func<CancellationToken, Task> action, CancellationToken cancellationToken = null)
    Parameters
    Type Name Description
    TimeSpan interval

    The interval between invocations of action.

    Func<CancellationToken, Task> action

    The callback to invoke periodically.

    CancellationToken cancellationToken

    A that can be used to cancel operations.

    Fields

    MinInterval

    The minimum interval between action invocations.

    The value of this field is equal to 100 milliseconds.

    Declaration
    public static readonly TimeSpan MinInterval
    Field Value
    Type Description
    TimeSpan

    Properties

    Interval

    Gets or sets the interval between periodic action invocations.

    Changes to this property take effect after next action invocation.

    Declaration
    public TimeSpan Interval { get; set; }
    Property Value
    Type Description
    TimeSpan
    See Also
    MinInterval

    Methods

    Dispose()

    Declaration
    public void Dispose()

    Finalize()

    Finalizes an instance of the PeriodicTask class.

    Declaration
    protected void Finalize()

    Comments

    Back to top Copyright © 2017-2019 Unosquare