Click or drag to resize

TimerTask Class

version: 10.9.0
Represents a timer task to be executed in the context of the corresponding IContext thread. To create and start a TimerTask please see Start(IContext, TimerCallback, TimerMode, Int64, Object).
Inheritance Hierarchy
SystemObject
  SolaceSystems.Solclient.MessagingTimerTask

Namespace:  SolaceSystems.Solclient.Messaging
Assembly:  SolaceSystems.Solclient.Messaging (in SolaceSystems.Solclient.Messaging.dll) Version: 10.9.0
Syntax
public abstract class TimerTask : IDisposable

The TimerTask type exposes the following members.

Constructors
  NameDescription
Protected methodTimerTask
Initializes a new instance of the TimerTask class
Top
Properties
  NameDescription
Public propertyDurationInMsecs
The duration in milliseconds of the timer.
Public propertyMode
The TimerMode specified when the timer is created Start(IContext, TimerCallback, TimerMode, Int64, Object)
Public propertyUserState
A reference to a user userState object. Passed in with the timer callback invocation.
Top
Methods
  NameDescription
Public methodDispose
Releases all resources used by the TimerTask
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodStatic memberStart
Factory method of TimerTasks. A TimerTask allows applications to execute a user-defined delegate in the context of a given IContext thread. The timer duration is subject to the timer resolution specified by the context property 'TimerResolutionInMsecs', up to the nearest timer resolution interval. For example, if the context timer resolution is 50 ms, and a timer is started with a duration of 60 ms, then the timer duration is rounded up to 100 ms (2 ticks), and then one further tick is added for a total timer duration of 150 ms. This extra tick accounts for the fact that the current tick might be just about to advance when the timer is started. Thus, the actual timeout in this example is approximately in the range of 100 ms to 150 ms.

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.

Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
See Also