Class TimerTrigger
- Namespace
- Common
- Assembly
- Lykke.Common.dll
Lykke timer implementation
public sealed class TimerTrigger : ITimerTrigger, IStartStop, IStartable, IStopable, IDisposable
- Inheritance
-
TimerTrigger
- Implements
-
IStartable
- Inherited Members
- Extension Methods
Constructors
TimerTrigger(string, TimeSpan, ILog)
Creates Lykke timer implementation
[Obsolete]
public TimerTrigger(string componentName, TimeSpan period, ILog log)
Parameters
componentName
stringName of the component, which will be used in the errors logging
period
TimeSpanPeriod between Triggered executions
log
ILogThe log
TimerTrigger(string, TimeSpan, ILog, TimerTriggeredEventHandler)
Creates Lykke timer implementation
[Obsolete]
public TimerTrigger(string componentName, TimeSpan period, ILog log, TimerTriggeredEventHandler handler)
Parameters
componentName
stringName of the component, which will be used in the errors logging
period
TimeSpanPeriod between
handler
/Triggered executionslog
ILogThe log
handler
TimerTriggeredEventHandlerHandler which will be trigger every time, when
period
is ellapsed.This is just shortcut to assign handler for Triggered
You do not need to catch exceptions just to for logging in handler of this event, infrastructure will do it for you.
TimerTrigger(string, TimeSpan, ILogFactory)
Creates Lykke timer implementation
public TimerTrigger(string componentName, TimeSpan period, ILogFactory logFactory)
Parameters
componentName
stringName of the component, which will be used in the errors logging
period
TimeSpanPeriod between Triggered executions
logFactory
ILogFactoryThe log
TimerTrigger(string, TimeSpan, ILogFactory, TimerTriggeredEventHandler)
Creates Lykke timer implementation
public TimerTrigger(string componentName, TimeSpan period, ILogFactory logFactory, TimerTriggeredEventHandler handler)
Parameters
componentName
stringName of the component, which will be used in the errors logging
period
TimeSpanPeriod between
handler
/Triggered executionslogFactory
ILogFactoryThe log
handler
TimerTriggeredEventHandlerHandler which will be trigger every time, when
period
is ellapsed.This is just shortcut to assign handler for Triggered
You do not need to catch exceptions just to for logging in handler of this event, infrastructure will do it for you.
Methods
DisableTelemetry()
Disables Application Insight telemetry for the timer
public TimerTrigger DisableTelemetry()
Returns
Dispose()
Disposes the timer
public void Dispose()
Start()
Starts the timer
public void Start()
Stop()
Stops the timer
public void Stop()
Events
Triggered
This event will be triggered when timer period is ellapsed.
You do not need to catch exceptions just for logging in handler of this event, infrastructure will do it for you.
Handler execution time is not included in the timer period.
public event TimerTriggeredEventHandler Triggered