Table of Contents

Class TimerPeriod

Namespace
Common
Assembly
Lykke.Common.dll

Timer that runs Execute method in a loop with a fixed time interval between runs (Execute method execution time is not included).

public abstract class TimerPeriod : IStartStop, IStartable, IStopable, IDisposable, ITimerCommand
Inheritance
TimerPeriod
Implements
IStartable
Inherited Members
Extension Methods

Constructors

TimerPeriod(int, ILog)

[Obsolete("Use protected TimerPeriod([NotNull] string componentName, int period, ILogFactory logFactory)")]
protected TimerPeriod(int periodMs, ILog log)

Parameters

periodMs int
log ILog

TimerPeriod(string, int, ILog)

[Obsolete("Use protected TimerPeriod([NotNull] string componentName, int period, ILogFactory logFactory)")]
protected TimerPeriod(string componentName, int periodMs, ILog log = null)

Parameters

componentName string
periodMs int
log ILog

TimerPeriod(TimeSpan, ILogFactory, string)

protected TimerPeriod(TimeSpan period, ILogFactory logFactory, string componentName = null)

Parameters

period TimeSpan
logFactory ILogFactory
componentName string

Properties

Log

[Obsolete("Use your own log")]
protected ILog Log { get; }

Property Value

ILog

Working

public bool Working { get; }

Property Value

bool

Methods

DisableTelemetry()

protected void DisableTelemetry()

Dispose()

public void Dispose()

Dispose(bool)

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

Execute()

public virtual Task Execute()

Returns

Task

Execute(CancellationToken)

public virtual Task Execute(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Returns

Task

GetComponentName()

public string GetComponentName()

Returns

string

SetLogger(ILog)

[Obsolete("Pass log to the ctor")]
protected void SetLogger(ILog log)

Parameters

log ILog

Start()

public virtual void Start()

Stop()

public virtual void Stop()