Click or drag to resize
ThreadWorkerT Class
Worker processing actions in single (one per application and generic variant), ever-running asynchronous thread.
Inheritance Hierarchy
SystemObject
  CMS.BaseThreadWorkerT
    CMS.BaseThreadQueueWorkerTItem, TWorker

Namespace: CMS.Base
Assembly: CMS.Base (in CMS.Base.dll) Version: 12.0.0
Syntax
C#
public abstract class ThreadWorker<T> : IDisposable
where T : new(), ThreadWorker<T>

Type Parameters

T

The ThreadWorkerT type exposes the following members.

Constructors
Fields
  NameDescription
Protected fieldStatic memberLOG_MAX_LENGTH
Maximum length of the worker log to prevent memory leaks
Protected fieldSyncRoot
Lock this object when doing actions that might change the result of condition run while stopping execution
Top
Properties
  NameDescription
Public propertyStatic memberCurrent
Current thread worker object
Protected propertyDefaultInterval
Gets the default interval in milliseconds for the worker.
Protected propertyStatic memberLog
Asynchronous log context used by the worker thread
Protected propertyMaintenanceInterval
Gets the maintenance interval in milliseconds for the worker. When 0 (default), the maintenance is not performed.
Protected propertyPollThread
Gets or sets thread which is periodically checking for new tasks.
Public propertyProcessingPaused
Indicates whether worker routine is temporarily paused.
Protected propertyUseLogContext
If true, the thread uses a log context for its operations
Top
Methods
  NameDescription
Protected methodCreateThreadSettings
Creates ThreadSettings object and enables the IsBackground and UseEmptyContext properties.
Public methodDispose
Disposes instance of thread worker.
Protected methodDispose(Boolean)
Disposes instance of thread worker.
Protected methodDoMaintenance
Runs the maintenance routine for the worker
Public methodEnsureRunningThread
Ensures a running thread for this processor
Protected methodFinish
Finishes the worker process.
Protected methodInitialize
Initializes the worker. Runs in the worker thread before the thread processes the first iteration.
Public methodIsThreadRunning
Returns true if the worker thread is currently running
Protected methodProcess
Method processing actions.
Protected methodRunProcess
Runs the internal process of the worker
Protected methodStopExecution
Stops the worker after finishing its job.
Top
See Also