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.EventLogEventLogWorker

Namespace: CMS.Base
Assembly: CMS.Base (in CMS.Base.dll) Version: 9.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 fieldStatic memberEvents
Events fired by the worker
Top
Properties
  NameDescription
Protected propertyDefaultInterval
Gets the default interval in milliseconds for the worker.
(Inherited from ThreadWorkerT.)
Protected propertyCheckDuplicity
If true, the queue checks the duplicity when inserting items. The duplicity is checked using the default comparer of the item.
Public propertyStatic memberItemsInQueue
Return the current number of items in the queue
Protected propertyLastRun
Last run time
(Inherited from ThreadWorkerT.)
Protected propertyMaintenanceInterval
Gets the maintenance interval in milliseconds for the worker. When 0 (default), the maintenance is not performed.
(Inherited from ThreadWorkerT.)
Protected propertyNextMaintenance
Next maintenance time
(Inherited from ThreadWorkerT.)
Protected propertyPollThread
Gets or sets thread which is periodically checking for new tasks.
(Inherited from ThreadWorkerT.)
Protected propertyUseLogContext
If true, the thread uses a log context for its operations
(Inherited from ThreadWorkerT.)
Top
Methods
  NameDescription
Protected methodAbortInternal
Aborts the worker and clears the queue
(Overrides ThreadWorkerTAbortInternal.)
Public methodStatic memberClearQueue
Clears the current queue
Protected methodCreateThread
Creates a worker thread object. Override to modify the thread configuration
(Inherited from ThreadWorkerT.)
Protected methodDequeue
Returns the first item in the queue and removes it
Protected methodDoMaintenance
Runs the maintenance routine for the worker
(Inherited from ThreadWorkerT.)
Public methodStatic memberEnqueue
Adds new item to processing queue
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.
(Inherited from ThreadWorkerT.)
Protected methodInitialize
Initializes the worker. Runs in the worker thread before the thread processes the first iteration.
(Inherited from ThreadWorkerT.)
Protected methodProcess
Method processing queues 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 methodRegisterInternal
Registers the worker
(Inherited from ThreadWorkerT.)
Protected methodResetInternal Obsolete.
Resets the worker and clears the queue
(Overrides ThreadWorkerTResetInternal.)
Protected methodRun
Runs the action.
(Inherited from ThreadWorkerT.)
Protected methodRunAsync
Runs the task in an asynchronous thread.
(Inherited from ThreadWorkerT.)
Protected methodRunMaintenance
Runs the maintenance routine for the worker if it should run.
(Inherited from ThreadWorkerT.)
Protected methodRunProcess
Runs the internal process of the worker
(Inherited from ThreadWorkerT.)
Top
See Also