Executing code using the batch framework

To force the process through the batch framework, we will use the execution modes: ReliableAsynchronous and ScheduledBatch.

Both of these methods submit jobs to the batch server for execution, where the ReliableAsynchronous method auto-deletes the jobs after execution.

The jobs do not execute immediately, but within a minute of submission; the batch server polls for waiting jobs every minute. We should use this method to perform asynchronous or scheduled jobs that require heavy processing.

Programmatically speaking, we wouldn't want to use the ScheduledBatch mode. This would be set based on the user choosing to run as a background task.

To submit the task as ReliableAsynchronous, simply change the code that constructs the controller to use this execution mode. On execution, you may notice that the information message indicates that nothing was done, but if you wait for about a minute and check the vehicle record, you will see that it has succeeded. You can also see the batch history for this.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.112.210