SayPro The Batch Job

The user prepares the steps and parameters for a task and submits it. The task runs asynchronously and the user receives a notification when the task is done. It’s good for tasks that take more than a few seconds to run, and especially good for jobs that run forever until cancelled. Google Alerts is a good example; it’s like a search query that never stops searching and sends you an email whenever their news spider discovers something that matches your query. Yet even something as humble as printing a letter is also a batch job because the user will want to work on another document while your program is working on queuing it up.Your model is a representation of the user’s command and any parameters, how it should respond when the task has produced results, and what the results are. You need to encapsulate all of it into a self-contained data structure (like "PrintJobCriteria" and "PrintJobResults" classes that share nothing with any other object) and make sure your business logic has thread-safe access to any resources so it can run safely in the background.When returning results to the user you must make sure you avoid any thread entanglement issues. Framework classes like BackgroundWorker are ideal for marshalling the results back onto the GUI.Please visit our website at www.saypro.online Email: info@sayro.online Call: + 27 (0) 11 071 1903 Email: info@saypro.online Tel: + 27 11 071 1903 WhatsApp: + 27 84 313 7407. Comment below for any questions and feedback. For SayPro Courses, SayPro Jobs, SayPro Community Development, SayPro Products, SayPro Services, SayPro Consulting, and SayPro Advisory visit our website to www.saypro.online


Comments

Leave a Reply