Creating Job Processor Worker Assemblies

In order to create a LEADTOOLS Job Processor Worker it is only necessary to create an assembly whose class derives from the JobBase class. After a new job is received, the windows service will spawn a new process to handle the job. The new process will load your worker assembly and call the OnJobReceived Method so that your assembly can begin working on the job. The typical workflow for implementing a worker can be summed up as follows:

  1. Create an assembly that derives from the JobBase class.

  2. Override the OnJobReceived Method to include any code necessary to start processing your job. This method should block until job processing is complete.

  3. Call UpdatePercentage to inform the windows service of the current progress. If the UpdatePercentage Method returns false, the job was either aborted or deleted by the user. When the UpdatePercentage Method returns false, stop processing and call the SetAbortedStatus Method. For more information, refer to the UpdatePercentage Method.

  4. Upon successful completion of the job processing, call the SetCompletedStatus Method.

  5. If the job fails for any reason call the SetFailureStatus Method.

If your process hangs, the windows service will terminate the process. If your process is killed or unexpectedly terminates, the worker assembly will be reloaded and the OnJobTerminated Method (if implemented) will be called so that you can react accordingly to the error. For more information, refer to OnJobTerminated.

The configuration file allows you to specify the namespace and class of your assembly, instructing the process which assembly to load when a new job is received. For more information, refer to LEADTOOLS Job Processor Settings.

References

Programming with the LEADTOOLS Distributed Computing (Job Processor) SDK LEADTOOLS Job Processor Settings Creating Job Processor Worker Assemblies Tutorial Understanding The LEADTOOLS Job Processor Database Deploying LEADTOOLS Distributed Computing (JobProcessor) Applications

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS Imaging, Medical, and Document