Click or drag to resize

AppTaskBatchProcessor Class

The application task processor handles the batch processing of application tasks as TaskProcessorJob's. The TaskQueueManager object delegates tasks to this task processor via the ProcessTasks(Vault, IEnumerableApplicationTask, CancellationToken)() method. - Registers the task queue passed in via the settings with the TaskQueueManager. - Enables task polling of the TaskQueueManager. - Exposes events [ BatchAdded ] -- BatchAdded => This event receives a TaskProcessorJob a.k.a. a batchJob. --- The individual batch job exposes life-cycle events [ ProcessingStarted, ProcessingCompleted, ProcessingFailed, CancellationRequested, ] --- These events can be used to keep local cached data in sync for --- vault applications or modules that need that sort of live updated info.
Inheritance Hierarchy
SystemObject
  MFiles.VAF.MultiserverModeCancellableOperationApplicationTask
    MFiles.VAF.MultiserverModeTaskProcessorBaseAppTaskBatchProcessorSettings
      MFiles.VAF.MultiserverModeAppTaskBatchProcessor

Namespace:  MFiles.VAF.MultiserverMode
Assembly:  MFiles.VAF (in MFiles.VAF.dll) Version: 2.2.0.9
Syntax
C#
public class AppTaskBatchProcessor : TaskProcessorBase<AppTaskBatchProcessorSettings>

The AppTaskBatchProcessor type exposes the following members.

Constructors
  NameDescription
Public methodAppTaskBatchProcessor
Primary constructor.
Top
Properties
  NameDescription
Protected propertyCurrentServer
Holds the attachment info for this server.
(Inherited from TaskProcessorBaseTSettings.)
Public propertyData
Data value clone container.
(Inherited from CancellableOperationT.)
Protected propertyLinkedTokenSource
Protected linked cancellation token source. - Used to request cancellation of the process.
(Inherited from CancellableOperationT.)
Protected propertySettings
Task processor settings.
(Inherited from TaskProcessorBaseTSettings.)
Public propertyTask
The system task that processes this operation.
(Inherited from CancellableOperationT.)
Public propertyToken
Linked cancellation token.
(Inherited from CancellableOperationT.)
Top
Methods
  NameDescription
Public methodAggregateActiveBatches
Collects an array of the active batches held by this processor.
Protected methodAggregateActiveTasks
Aggregates the tasks from all active batches.
Public methodAllowNewTaskRequests
This will denote if new tasks can be accepted by the task processor.
(Inherited from TaskProcessorBaseTSettings.)
Public methodAllowNewTaskRequests(Boolean)
This will update the allow new task requests getter method AllowNewTaskRequests. Note that this may or may not actually change the value, since multiple requests may be required to actually toggle the value since it may be used in multiple threads.
(Inherited from TaskProcessorBaseTSettings.)
Public methodBroadcastVaultExtensionMethodCall(Int32, Vault, ListString)
Re-Broadcast the broadcast message so all servers.
(Inherited from TaskProcessorBaseTSettings.)
Public methodCanAcceptNewTasks
Function used to determine if the application task processor can accept any new tasks.
(Overrides TaskProcessorBaseTSettingsCanAcceptNewTasks.)
Public methodCanCancelTask
Determines if the app task can be canceled .
(Inherited from TaskProcessorBaseTSettings.)
Public methodCancel
Requests cancellation of the operation.
(Inherited from CancellableOperationT.)
Public methodCancelAfter
Requests cancellation of the operation.
(Inherited from CancellableOperationT.)
Public methodCancelAll
Requests immediate cancellation of this and all child tasks.
Public methodCancelAll(Int32)
Allows canceling with a cancellation delay.
Public methodCancelAll(TimeSpan)
Allows canceling with a timespan delay.
Protected methodCanUpdateProgress
Determines if the app task can have its progress updated.
(Inherited from TaskProcessorBaseTSettings.)
Public methodCreateApplicationTaskSafe
Helper method used to create a task in the task queue, accounting for the potential that the task queue has been destroyed. - If the task queue is not found, the RegisterTaskQueue() method is called, then the create task is attempted a 2nd time.
(Inherited from TaskProcessorBaseTSettings.)
Public methodCreateApplicationTaskSafeInTransaction
Helper method used to create a task in the task queue, accounting for the potential that the task queue has been destroyed. - If the task queue is not found, the RegisterTaskQueue() method is called, then the create task is attempted a 2nd time.
(Inherited from TaskProcessorBaseTSettings.)
Public methodGetLatestTaskInfo
Resolves the latest task info, by id from the server.
(Inherited from TaskProcessorBaseTSettings.)
Protected methodInjectBuiltInHandlers
Injects built in task handlers.
(Inherited from TaskProcessorBaseTSettings.)
Protected methodOnBatchAdded
BatchAdded event invoker.
Protected methodOnBatchCreated
BatchCreated event invoker.
Protected methodOnCancellationRequested
Cancellation requested event invocation.
(Inherited from CancellableOperationT.)
Protected methodOnJobCreated
Job created event invocation.
(Inherited from TaskProcessorBaseTSettings.)
Public methodProcessBatch
Assigns the processing of a batch to a system task.
Public methodProcessTasks (Overrides TaskProcessorBaseTSettingsProcessTasks(Vault, IEnumerableApplicationTask, CancellationToken).)
Public methodRegisterTaskQueues
Verifies that the task queue is open. - Opens the queue if it is found to be missing.
(Inherited from TaskProcessorBaseTSettings.)
Public methodResetCancellationToken
Resets the cancellation token source.
(Inherited from CancellableOperationT.)
Public methodSendBroadcastMessageSafe
Helper method used to send an application task queue broadcast message, accounting for the potential that the task queue has been destroyed. - If the task queue is not found, the RegisterTaskQueue() method is called, then the message creation - is attempted a 2nd time.
(Inherited from TaskProcessorBaseTSettings.)
Public methodSendBroadcastMessageSafeInTransaction
Helper method used to send an application task queue broadcast message, accounting for the potential that the task queue has been destroyed. - If the task queue is not found, the RegisterTaskQueue() method is called, then the message creation - is attempted a 2nd time.
(Inherited from TaskProcessorBaseTSettings.)
Protected methodTaskHandler_VaultExtMethodCaller
Generic vault extension method caller.
(Inherited from TaskProcessorBaseTSettings.)
Public methodThrowIfCancellationRequested
If cancellation has been requested: - The CancellationRequest event is fired. - Then the cancellation exception is thrown.
(Inherited from CancellableOperationT.)
Protected methodThrowIfNull
Asserts the passed object is not null.
(Inherited from CancellableOperationT.)
Protected methodTriggerCancellationRequested
Triggers the cancellation requested event, for any registered listeners.
(Inherited from CancellableOperationT.)
Protected methodTriggerPolling
Triggers polling right away for the TaskQueueManager.
(Inherited from TaskProcessorBaseTSettings.)
Protected methodTryGetStatusInfo
Resolves the status info, when available. - Null otherwise.
(Inherited from TaskProcessorBaseTSettings.)
Protected methodTryGetTraceInfo
Resolves the trace info, when available and configured to do so. - Null otherwise.
(Inherited from TaskProcessorBaseTSettings.)
Public methodUnregisterTaskQueues
Detaches the task queue in the settings object for this processor from monitoring by the TaskQueueMonitor.
(Inherited from TaskProcessorBaseTSettings.)
Public methodUpdateCancelledJobInTaskQueue(ApplicationTask, String, String, Boolean)
Updates the passed job as having been cancelled in the task queue.
(Inherited from TaskProcessorBaseTSettings.)
Public methodUpdateCancelledJobInTaskQueue(TaskProcessorJob, String, String, Boolean)
Updates the passed job as having been cancelled in the task queue.
(Inherited from TaskProcessorBaseTSettings.)
Public methodUpdateCompletedJobInTaskQueue(ApplicationTask, String, String, Boolean)
Updates the completed app task in the task queue.
(Inherited from TaskProcessorBaseTSettings.)
Public methodUpdateCompletedJobInTaskQueue(TaskProcessorJob, String, String, Boolean)
Updates the completed app task in the task queue.
(Inherited from TaskProcessorBaseTSettings.)
Public methodUpdateFailedJobInTaskQueue(ApplicationTask, String, Exception, String, Boolean)
Updates the task in the application task queue, with failed info.
(Inherited from TaskProcessorBaseTSettings.)
Public methodUpdateFailedJobInTaskQueue(TaskProcessorJob, String, Exception, String, Boolean)
Updates the task in the application task queue, with failed info.
(Inherited from TaskProcessorBaseTSettings.)
Public methodUpdateProgressForActiveTasks
Forces an update of the task info for tasks with ongoing processing.
Public methodUpdateTaskAsAssignedToProcessor
Update task info as having been assigned implementation.
(Inherited from TaskProcessorBaseTSettings.)
Public methodUpdateTaskInfo(ApplicationTask, MFTaskState, String, Boolean)
Updates the task info inside the task queue for the passed application task.
(Inherited from TaskProcessorBaseTSettings.)
Public methodUpdateTaskInfo(TaskProcessorJob, MFTaskState, String, Boolean)
Update task info implementation.
(Inherited from TaskProcessorBaseTSettings.)
Public methodUpdateTasksInProgress
Updates the progress in the task queue. - This check is part of the required keep alive updates to the task queue.
(Inherited from TaskProcessorBaseTSettings.)
Public methodWaitAll
Waits indefinitely (or until this cancellation token for this processor has the cancellation requested) for all child tasks to exit.
(Overrides TaskProcessorBaseTSettingsWaitAll.)
Public methodWaitAll(Int32)
Waits for all child tasks to exit.
Public methodWaitAll(TimeSpan)
Waits for all child tasks to exit.
Top
Events
  NameDescription
Public eventBatchAdded
The Event fired when a new batch is added. - Used to bind to each new batch job, which in turn exposes that individual batch job's life-cycle events.
Public eventBatchCreated
The Event fired when a new batch is created. - Used to bind to each new batch job, which in turn exposes that individual batch job's life-cycle events.
Public eventCancellationRequested
Event fired on cancellation requested.
(Inherited from CancellableOperationT.)
Public eventJobCreated
Job created event.
(Inherited from TaskProcessorBaseTSettings.)
Top
See Also