PHP code example of arefshojaei / job-queue-system

1. Go to this page and download the library: Download arefshojaei/job-queue-system library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

arefshojaei / job-queue-system example snippets


interface Job
{
    public function handle(): void;
}

class SendEmailJob implements Job
{
    public function handle(): void
    {
        // Your background logic goes here
    }
}

interface Job
{
    public function handle(): void;
}
bash
# Create 'jobs' & 'failed_jobs' tables
php cli db:init jobs

# Clean (Truncate) 'jobs' & 'failed_jobs' tables
php cli db:clean jobs

# Drop 'jobs' & 'failed_jobs' tables
php cli db:drop jobs
bash
php cli job:list
bash
php cli job:test sample
bash
php cli db:clean jobs
bash
php cli db:drop jobs