LEADTOOLS Cloud (Leadtools.Cloud.Job assembly)
LEAD Technologies, Inc

OnJobReceived Method






A System.String that represents the ID (GUID) of the new job.
The user token stores information related to the client that submitted the job.
Metadata containing information on how this job should be processed.
Type of job. Job Types are defined in the Workers.xml. For more information on the Workers.XML configuration, refer to LEADTOOLS Cloud Settings.
Frequency, in seconds, that progress is reported using the UpdatePercentage Method.
Processes new jobs when they are available and ready for processing.
Syntax
public abstract void OnJobReceived( 
   string id,
   string userToken,
   string jobMetadata,
   string jobType,
   int progressRate
)
'Declaration
 
Public MustOverride Sub OnJobReceived( _
   ByVal id As String, _
   ByVal userToken As String, _
   ByVal jobMetadata As String, _
   ByVal jobType As String, _
   ByVal progressRate As Integer _
) 
'Usage
 
Dim instance As JobBase
Dim id As String
Dim userToken As String
Dim jobMetadata As String
Dim jobType As String
Dim progressRate As Integer
 
instance.OnJobReceived(id, userToken, jobMetadata, jobType, progressRate)
public abstract void OnJobReceived( 
   string id,
   string userToken,
   string jobMetadata,
   string jobType,
   int progressRate
)
 function Leadtools.Cloud.Job.JobBase.OnJobReceived( 
   id ,
   userToken ,
   jobMetadata ,
   jobType ,
   progressRate 
)
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 Cloud Settings.
progressRate
Frequency, in seconds, that progress is reported using the UpdatePercentage Method.
Remarks

When creating a cloud 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 cloud workers, refer to Creating Cloud 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 Cloud Database.

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

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

JobBase Class
JobBase Members
Programming with LEADTOOLS Cloud SDK
Creating Cloud Worker Assemblies
AddJob Method

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.