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
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
TimerPeriod(TimeSpan, ILogFactory, string)
protected TimerPeriod(TimeSpan period, ILogFactory logFactory, string componentName = null)
Parameters
period
TimeSpanlogFactory
ILogFactorycomponentName
string
Properties
Log
[Obsolete("Use your own log")]
protected ILog Log { get; }
Property Value
Working
public bool Working { get; }
Property Value
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
Execute(CancellationToken)
public virtual Task Execute(CancellationToken cancellationToken)
Parameters
cancellationToken
CancellationToken
Returns
GetComponentName()
public string GetComponentName()
Returns
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()