In the web development process the use of batch operations enables forms processing to be performed in the course of several requests. This prevents interrupts in form processing that might occur due to PHP time-out. The user, also, keeps being informed about the current operations running. The batch is considered to have been initially developed to secure harmonic integration with Forms API, it has often been used, though, in writing ordinary scripts like update.php.
Say, we need to process big data. First, we will create a page in hook_menu.
/** * Batch form */ function module_brand_batch(&$form_state) { $form['submit'] = array( '#type' => 'submit', '#value' => t('Start batch'), '#description' => t("Make some operations"), '#submit' => array('module_batch_submit'), ); return $form; }