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: 9.0.0
Syntax
C#
public abstract class ThreadWorker<T>
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 (100kB by default)
Top
Properties
  NameDescription
Protected propertyStatic memberCurrent
Current thread worker object
Protected propertyDefaultInterval
Gets the default interval in milliseconds for the worker.
Protected propertyLastRun
Last run time
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 propertyNextMaintenance
Next maintenance time
Protected propertyPollThread
Gets or sets thread which is periodically checking for new tasks.
Public propertyStatic memberProcessingPaused
If set to true, tasks from queue will not be processed.
Protected propertyUseLogContext
If true, the thread uses a log context for its operations
Top
Methods
  NameDescription
Public methodStatic memberAbort
Aborts the worker
Protected methodAbortInternal
Aborts the worker
Protected methodCreateThread
Creates a worker thread object. Override to modify the thread configuration
Protected methodDoMaintenance
Runs the maintenance routine for the worker
Public methodStatic memberEnsureRunningThread
Ensures a running thread for this processor
Protected methodFinish
Finishes the worker process. Implement this method to specify what the worker must do in order to not lose its internal data when being finished. Leave empty if no extra action is required.
Protected methodInitialize
Initializes the worker. Runs in the worker thread before the thread processes the first iteration.
Public methodStatic memberIsThreadRunning
Returns true if the worker thread is currently running
Protected methodProcess
Method processing actions.
Public methodStatic memberRegister
Registers the worker so that it runs within the system
Protected methodRegisterInternal
Registers the worker
Public methodStatic memberReset Obsolete.
Resets the worker
Protected methodResetInternal Obsolete.
Resets the worker
Protected methodRun
Runs the action.
Protected methodRunAsync
Runs the task in an asynchronous thread.
Protected methodRunMaintenance
Runs the maintenance routine for the worker if it should run.
Protected methodRunProcess
Runs the internal process of the worker
Public methodStatic memberStopExecution
Stops the worker after finishing its job
Top
See Also