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
      CMS.WebFarmSyncWebFarmUpdaterAsync

Namespace: CMS.Base
Assembly: CMS.Base (in CMS.Base.dll) Version: 8.2.23
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
Methods
  NameDescription
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
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
Extension Methods
  NameDescription
Public Extension MethodAsValue
Converts object to a query value which can be used as a query parameter
(Defined by QueryExtensions.)
Public Extension MethodGetAPIString
Gets the string by the specified resource key
(Defined by CoreExtensions.)
Public Extension MethodGetString
Gets the string by the specified resource key
(Defined by CoreExtensions.)
Public Extension MethodToBoolean
Returns the boolean representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToDateTime
Returns the DateTime representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToDouble
Returns the double representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToGuid
Returns the Guid representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToInteger
Returns the integer representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToString
Returns the string representation of an object or default value if not.
(Defined by CoreExtensions.)
Top
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.)
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
(Inherited from ThreadWorkerT.)
Top
See Also