Embed presentation





















Batch API allows processing jobs in batches to avoid PHP timeouts and provide feedback to users. It spreads work over multiple page requests. Key functions include batch_get(), batch_process(), and batch_set(). It works by setting a batch operation, executing it outside a form submit handler, updating context values in each step, and checking when steps are finished. The cron queue similarly processes large amounts of data from cron jobs by defining a queue in hook_cron_queue_info(), loading items in hook_cron(), and processing individual items with a worker callback.




















