Table of Contents

Class SchedulerService

Namespace
nanoFramework.Hosting
Assembly
nanoFramework.Hosting.dll

Base class timer service which calls an asynchronous action after the configured interval.

public abstract class SchedulerService : IHostedService, IDisposable
Inheritance
SchedulerService
Implements
Inherited Members
Extension Methods

Constructors

SchedulerService(int, int, TimeSpan)

Schedules the execution of ExecuteAsync() on the provided interval.

protected SchedulerService(int hour, int min, TimeSpan interval)

Parameters

hour int

The hour the scheduler will start on.

min int

The miniute the scheduler will start on.

interval TimeSpan

The TimeSpan interval scheduler will execute on.

SchedulerService(TimeSpan)

Schedules the immediate execution of ExecuteAsync() on the provided interval.

protected SchedulerService(TimeSpan interval)

Parameters

interval TimeSpan

The TimeSpan interval scheduler will execute on.

Properties

Interval

Gets the interval of the timer.

protected TimeSpan Interval { get; }

Property Value

TimeSpan

Time

Gets the due time of the timer.

protected TimeSpan Time { get; }

Property Value

TimeSpan

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public virtual void Dispose()

ExecuteAsync()

This method is called each time the timer elapses.

protected abstract void ExecuteAsync()

ExecuteTimer()

Gets the Timer that executes the background operation.

public virtual Timer ExecuteTimer()

Returns

Timer

Remarks

Will return null if the background operation hasn't started.

Start()

Triggered when the application host is ready to start the service.

public virtual void Start()

Stop()

Triggered when the application host is performing a graceful shutdown.

public virtual void Stop()