IWebFarmServiceRegisterTask Method (Type, Boolean, WebFarmTaskOptimizeActionEnum) |
Registers a new web farm task type to allow its processing within the system. The type must inherit
WebFarmTaskBase.
Namespace: CMS.CoreAssembly: CMS.Core (in CMS.Core.dll) Version: 13.0.131
Syntax void RegisterTask(
Type taskType,
bool isMemoryTask = false,
WebFarmTaskOptimizeActionEnum webFarmTaskOptimize = WebFarmTaskOptimizeActionEnum.None
)
Parameters
- taskType
- Type: SystemType
The type of task to register. - isMemoryTask (Optional)
- Type: SystemBoolean
Indicates if the task modifies memory only. Memory tasks can be deleted on application start. - webFarmTaskOptimize (Optional)
- Type: CMS.CoreWebFarmTaskOptimizeActionEnum
Determines type of optimization which is used for reducing number of generated web farm tasks of particular type.
Exceptions Exception | Condition |
---|
ArgumentNullException | Thrown when taskType is null. |
ArgumentException | Thrown when taskType does not inherit WebFarmTaskBase or does not have parameterless constructor. |
InvalidOperationException | Thrown when task with type taskType has been already registered. |
See Also