pw-queue
Use when creating, dispatching, or interacting with Queue jobs in ProcessWire (processwire-console file-based queues).
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Use when creating, dispatching, or interacting with Queue jobs in ProcessWire (processwire-console file-based queues).
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Use when building, structuring, or refactoring native backend modules for ProcessWire using PHP 8.4 and strict typing.
Use when designing, structuring, or rendering HTML for ProcessWire Admin interfaces, custom Process modules, or Inputfields.
Use when brainstorming or designing ProcessWire modules, templates, field schemas, or hooks to resolve ambiguity and validate architecture before implementation.
Use when creating, executing, or managing Pest tests within ProcessWire or ProcessWire modules, including Test-Driven Development (TDD) tasks.
Use when encountering any bug, test failure, blank screen of death, or unexpected behavior in ProcessWire before proposing fixes.
Use when creating or updating module documentation, package READMEs, architecture guides, or CLI command references for ProcessWire projects.
| name | pw-queue |
| description | Use when creating, dispatching, or interacting with Queue jobs in ProcessWire (processwire-console file-based queues). |
| risk | safe |
| source | processwire-boost |
| date_added | 2026-04-09 |
This specific project implements a background job queue system out-of-the-box via the processwire-console package using a lightweight database implementation (queue_jobs and failed_jobs).
site/queue/*Queue.php (for global tasks) or site/modules/[ModuleName]/queue/*Queue.php (for module-scoped tasks).Queue (e.g., SendEmailQueue) and match their filenames (SendEmailQueue.php).Totoglu\Console\Queue\Queue.A basic queue class relies on a handle() method.
<?php
declare(strict_types=1);
namespace Site\Queue;
use Totoglu\Console\Queue\Queue;
class SendEmailQueue extends Queue
{
public function handle(array $payload): void
{
// 1. Unpack payload cautiously
$to = $payload['to'] ?? null;
$body = $payload['body'] ?? null;
if (!$to || !$body) {
throw new \Exception("Invalid payload");
}
// 2. Perform process safely
$mail = \ProcessWire\wireMail();
$mail->to($to)->subject('Background Mail')->body($body)->send();
}
}
To push jobs into the database from anywhere in ProcessWire:
use Totoglu\Console\Queue\Queue;
// The Queue dispatcher automatically discovers classes by their basename.
Queue::push('SendEmailQueue', [
'to' => 'user@example.com',
'body' => 'Welcome to the system!'
]);
Always manage the active/failed queues using wire commands:
wire queue:table - Use this FIRST to install/scaffold the database tables if they do not exist.wire queue:work - Starts the background daemon processor. If asked to "start the queue", run this.wire queue:failed - Lists jobs that failed completely after exhausting attempts.wire queue:retry {id} - Pushes a failed job back onto the main queue for processing.wire queue:clear - Purge all failed jobs.$database->exec('INSERT INTO queue_jobs...'). Always use Queue::push().ProcessEmails.php. It MUST be ProcessEmailsQueue.php.Site\Queue or ProcessWire).