![on error in xojo on error in xojo](https://blog.xojo.com/wp-content/uploads/2016/08/2016-08-02_11-00-54.png)
#ON ERROR IN XOJO UPDATE#
You can use this method to update your job list or do other housekeeping. JobCompleted: When JobRun finishes, the JobCompleted event is called and the value that was returned from JobRun is provided here. In addition, when a job is finished a new job is requested by calling JobRequested. You can return a String from this event to provide information about the job that just finished running. The only data the Worker gets is what is passed in, which it can then use to look up additional data elsewhere.
#ON ERROR IN XOJO CODE#
Remember that this code is independent and should not refer to any values that were set in your app as they won’t be available in the Worker. The parameter contains a String with the information that was returned from JobRequested.
![on error in xojo on error in xojo](https://www.mbs-plugins.de/images/image-error-with.jpg)
JobRun: The code in this event runs in the Worker Console app where it can make use of multiple CPU cores. When there are no more jobs, return an empty string to tell the Worker it can quit. Instead, allow the Worker to get what it needs based on the information you return here. However, you should avoid passing round large amounts of data as that is slower and will use more memory. You can return information here such as a path to a file, a key to a database table, a URL, or whatever else makes sense. Here you can return a String containing details about the Job that the Worker will run. JobRequested: When a Worker is first started, it requests a job which calls this method in your app.
![on error in xojo on error in xojo](https://forum.xojo.com/uploads/default/original/2X/6/6a2cd2245956888037f2495913e8c91a1c4d90fa.png)
The Worker object itself has five events you use to project jobs for the Worker to do. However you may not need everything, so you can choose to be specific about which supporting classes and modules you want to include (one project item per line).
![on error in xojo on error in xojo](https://forum.xojo.com/uploads/default/original/2X/2/2efcf7d5e98948771b861292b15b8ffc25089ef2.png)
When run in Debug mode, Workers use Threads to simulate separate Console apps to make debugging easier. Note: For now, Worker can be used with Desktop projects, but we plan to make it available for Web projects in the future. Since these run as Console apps, the OS treats them as separate processes and spreads them out amongst available CPU cores. One or more of these console apps are started based on your Worker settings. A Worker provides a way for you to have code that runs on multiple CPU cores.Ī Worker achieves this by running its code in a Console app. One of the many new features included in 2020 Release 2 is the Worker class.