Queue API

Copilot
Template Prompt
Intermediate

Prompt

<?php

namespace Drupal\mymodule\Plugin\QueueWorker;

use Drupal\Core\Queue\QueueWorkerBase;

/**
 * @QueueWorker(
 *   id = "mymodule_processor",
 *   title = @Translation("My Module Processor"),
 *   cron = {"time" = 60}
 * )
 */
class MyModuleProcessor extends QueueWorkerBase {
  
  public function processItem($data): void {
    // Process queue item
  }
}