Skip to content
  • totten's avatar
    Civi::queue() - Add support for 'template' queues · b656ba01
    totten authored
    Overview
    --------
    
    Suppose you are in the habit of making separate queue-instances for
    different batches of work.  However, you want to allow the sysadmin to
    configure options like `type`, `batch_limit`, and `retry_interval`.
    
    Solution: Make a template
    
    After
    -----
    
    ```php
    // Use the API to register a template, eg
    \Civi\Api4\Queue::create()->setValues([
      'name' => 'template-name',
      'is_template' => TRUE,
      ...
    ])->execute();
    
    // Later, create a queue from the template
    $q = Civi::queue('new-queue', ['template' => 'template-name']);
    ```
    b656ba01