Table of Contents

Method ScheduleRepeating

Namespace
Anvil.Services
Assembly
NWN.Anvil.dll

ScheduleRepeating(Action, TimeSpan, TimeSpan)

Schedules the specified task to be invoked on a specified schedule, after an optional delay.

public ScheduledTask ScheduleRepeating(Action action, TimeSpan schedule, TimeSpan delay = default)

Parameters

action Action

The task/action to be run.

schedule TimeSpan

The delay between invocations.

delay TimeSpan

An additional delay for the first time run.

Returns

ScheduledTask

A disposable object representing the scheduled task. Calling Dispose() will cancel the schedule and any future invocations.

Exceptions

ArgumentOutOfRangeException

Thrown if the schedule is less than 0.

ArgumentNullException

Thrown if no action is specified.