Creating a Job

The Zend Server Job Queue component provides the ability to off-load script execution using JobsClosed Jobs contain information about a specific Job (script to run) that you have set to run in your environment.. A Job is in essence a command to execute a PHP script according to the specific parameters you give it. The Job QueueClosed A simple and manageable system for off-loading tasks from the synchronous user request, to an external, parallel PHP process. component manages the timing and execution of jobs in the system.

Jobs can be created to facilitate a wide range of situations that require you to asynchronously run PHP code. Here are a few examples:

  • Action Based Jobs for back-end activities which are not a part of the HTTP request-response interaction with end users and need to be executed asynchronously.
  • Scheduled Jobs that are set to execute according to a predefined schedule.
  • One-time jobs that need to be run for any reason.
  • Improving Website performance by offloading processes to a different server.
  • Optimizing long script execution by deferring running scripts to low peak times.
  • Unifying script usage by referring to a job script outside the application code instead of repeating the same code for the same functionality. This also provides the added advantage of being able to implement changes throughout the application be editing a single script (instead of editing each individual instance of the script throughout the application's code).