OnJobReceived Method

Summary

Processes new jobs when they are available and ready for processing.

Syntax
C#
VB
C++
public abstract void OnJobReceived( 
   string id, 
   string userToken, 
   string jobMetadata, 
   string jobType, 
   int progressRate 
) 
  
Public MustOverride Sub OnJobReceived( _ 
   ByVal id As String, _ 
   ByVal userToken As String, _ 
   ByVal jobMetadata As String, _ 
   ByVal jobType As String, _ 
   ByVal progressRate As Integer _ 
)  
public: 
abstract void OnJobReceived(  
   String^ id, 
   String^ userToken, 
   String^ jobMetadata, 
   String^ jobType, 
   int progressRate 
)  

Parameters

id
A System.String that represents the ID (GUID) of the new job.

userToken
The user token stores information related to the client that submitted the job.

jobMetadata
Metadata containing information on how this job should be processed.

jobType
Type of job. Job Types are defined in the Workers.xml. For more information on the Workers.XML configuration, refer to LEADTOOLS JobProcessor Settings.

progressRate
Frequency, in seconds, that progress is reported using the UpdatePercentage Method.

Remarks

When Creating a Job Processor worker, your custom assembly will be loaded to process the job. When loaded, the OnJobReceived Method will be called to notify your assembly a new job is ready to be processed. Your implementation of the OnJobReceived Method should block until job processing is complete. For more information on creating Job Processor workers, refer to Creating Job Processor Worker Assemblies.

Post the progress of the current job using the UpdatePercentage Method. Failure to post progress can cause the windows service to assume the process is hung and the windows service will terminate the process. Progress should be posted at the interval specified by the progressRate parameter.

For more information on how the userToken, jobMetadata, and jobType properties are used, refer to Understanding The LEADTOOLS Job Processor Database.

Example

Refer to the OCRJobProcessorDemo. Depending on the programming language being used, the demo will be found in either the <installationdir>\Examples\DotNet\CS\OCRJobProcessorDemo directory. or the <installationdir>\Examples\DotNet\VB\OCRJobProcessorDemo directory. The <installationdir> represents the directory in which you installed the LEADTOOLS toolkit.

Requirements

Target Platforms

Help Version 20.0.2019.9.19
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2019 LEAD Technologies, Inc. All Rights Reserved.