Shutdown function: Stores the current batch data for the next request.
_batch_page()
drupal_register_shutdown_function()
function _batch_shutdown() { if (($batch = batch_get()) && _batch_needs_update()) { \Drupal::service('batch.storage')->update($batch); } }