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

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

Type Parameters

TItem
TWorker

The ThreadQueueWorkerTItem, TWorker type exposes the following members.

Constructors
Fields
  NameDescription
Public fieldEvents
Events fired by the worker
Protected fieldSyncRoot
Lock this object when doing actions that might change the result of condition run while stopping execution
(Inherited from ThreadWorkerT.)
Top
Properties
  NameDescription
Protected propertyCheckDuplicity
If true, the queue checks the duplicity when inserting items. The duplicity is checked using the default comparer of the item.
Protected propertyDefaultInterval
Gets the default interval in milliseconds for the worker.
(Inherited from ThreadWorkerT.)
Public propertyItemsInQueue
Return the current number of items in the queue
Protected propertyMaintenanceInterval
Gets the maintenance interval in milliseconds for the worker. When 0 (default), the maintenance is not performed.
(Inherited from ThreadWorkerT.)
Protected propertyPollThread
Gets or sets thread which is periodically checking for new tasks.
(Inherited from ThreadWorkerT.)
Public propertyProcessingPaused
Indicates whether worker routine is temporarily paused.
(Inherited from ThreadWorkerT.)
Protected propertyUseLogContext
If true, the thread uses a log context for its operations
(Inherited from ThreadWorkerT.)
Top
Methods
  NameDescription
Protected methodCreateThreadSettings
Creates ThreadSettings object and enables the IsBackground and UseEmptyContext properties.
(Inherited from ThreadWorkerT.)
Public methodDispose
Disposes instance of thread worker.
(Inherited from ThreadWorkerT.)
Protected methodDispose(Boolean)
Disposes instance of thread worker.
(Inherited from ThreadWorkerT.)
Protected methodDoMaintenance
Runs the maintenance routine for the worker
(Inherited from ThreadWorkerT.)
Public methodEnqueue
Adds new item to processing queue.
Public methodEnsureRunningThread
Ensures a running thread for this processor
(Inherited from ThreadWorkerT.)
Protected methodFinish
Finishes the worker process.
(Inherited from ThreadWorkerT.)
Protected methodInitialize
Initializes the worker. Runs in the worker thread before the thread processes the first iteration.
(Inherited from ThreadWorkerT.)
Public methodIsThreadRunning
Returns true if the worker thread is currently running
(Inherited from ThreadWorkerT.)
Protected methodProcess
Method processing queued actions.
(Overrides ThreadWorkerTProcess.)
Protected methodProcessItem
Processes the item in the queue. Override this method to process a single item from the queue.
Protected methodProcessItems
Processes the given list of items. Override this method to process queued items as a bulk. Returns the number of processed items.
Protected methodRunProcess
Runs the internal process of the worker
(Inherited from ThreadWorkerT.)
Protected methodStopExecution
Stops the worker after finishing its job.
(Inherited from ThreadWorkerT.)
Top
See Also