TimerTaskStart Method |
The timer callback delegate is invoked in the context of the context thread. The timer durations are approximate; the actual duration can be affected by the processing time spent in other callbacks by the context thread, such as for session or flowEvent events and received messages.
Note: disposing the corresponding context (IContext) or any of its contained context timers (TimerTask), sessions (ISession) or flows (IFlow) must not be performed from within the registered userCallbackDelegate.
This timer service should only be used for applications that require a coarse timer service (for example, a guard timer, or other timer uses that do not require a highly accurate timer service).
When a one-shot timer expires, the timer is automatically cancelled. When a repeat timer expires, the timer is automatically rescheduled for the same duration, and continues to run until stopped using Dispose.Note that the invoked timer callback delegate routine is allowed to start and stop timers.
Namespace: SolaceSystems.Solclient.Messaging
Assembly: SolaceSystems.Solclient.Messaging (in SolaceSystems.Solclient.Messaging.dll) Version: 7.2.1.27 (7.2.1.27)
public static TimerTask Start( IContext context, TimerCallback userCallbackDelegate, TimerMode timerMode, long durationInMsecs, Object userState )
Public Shared Function Start ( context As IContext, userCallbackDelegate As TimerCallback, timerMode As TimerMode, durationInMsecs As Long, userState As Object ) As TimerTask
public: static TimerTask^ Start( IContext^ context, TimerCallback^ userCallbackDelegate, TimerMode timerMode, long long durationInMsecs, Object^ userState )
Parameters
- context
- Type: SolaceSystems.Solclient.MessagingIContext
The IContext to schedule the timer on - userCallbackDelegate
- Type: System.ThreadingTimerCallback
The user callback delegate to call when the timer expires. The call occurs over the IContext thread - timerMode
- Type: SolaceSystems.Solclient.MessagingTimerMode
Use OneShot to create a one shot timer, Repeat otherwise - durationInMsecs
- Type: SystemInt64
The timer interval in milliseconds. This is subject to the specified timer resolution see Start(IContext, TimerCallback, TimerMode, Int64, Object) for more details - userState
- Type: SystemObject
An object reference that's passed to the userCallbackDelegate when the timer expires, can be null
Return Value
Type: TimerTaskReturns a TimerTask