Download the PHP package neuron-php/jobs without Composer
On this page you can find all versions of the php package neuron-php/jobs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package jobs
Neuron-PHP Job Scheduler & Queue
A lightweight job scheduler and queue system for PHP 8.4+. Schedule recurring tasks with cron expressions and process background jobs with a reliable queue system.
Features
- Combined Runner: Single command to run scheduler and worker together
- Job Scheduling: Schedule recurring jobs with cron expressions
- Queue System: Background job processing with retry logic
- Multiple Drivers: Database, file, or synchronous execution
- Failed Job Management: Track, retry, and monitor failed jobs
- Helper Functions: Simple API for dispatching jobs
Quick Start
That's it! The jobs:run command handles both scheduled tasks and queued jobs.
Installation
Configure PSR-4 autoloading in composer.json:
Directory Structure
Configuration
Application Configuration (neuron.yaml)
Queue Drivers:
- database: Persistent queue in database (recommended for production)
- file: File-based queue in storage directory
- sync: Execute jobs immediately (for testing)
Job Scheduling
Schedule Configuration (config/schedule.yaml)
Configuration Options:
class: Job class name (required)cron: Cron expression for schedule (required)args: Arguments passed to job (optional)queue: Queue name for background processing (optional)
When to Use Queue Dispatch:
- Without queue: Quick jobs (< 1 second) that won't block scheduler
- With queue: Long-running jobs requiring retries and monitoring
Creating Scheduled Jobs
Jobs implement the Neuron\Jobs\IJob interface:
Running Jobs
The job system can be run in three different modes depending on your needs:
1. Combined Mode (Recommended)
Run both scheduler and queue worker together with a single command:
This is the easiest way to run the complete job system. It manages both the scheduler and worker in one process.
Options:
--schedule-interval=30- Scheduler polling interval in seconds (default: 60)--queue=emails,default- Queue(s) to process (default: default)--worker-sleep=5- Worker sleep when queue is empty (default: 3)--worker-timeout=120- Job timeout in seconds (default: 60)--max-jobs=100- Max jobs before restarting worker (default: unlimited)
Examples:
2. Scheduler Only
Run just the scheduler for executing scheduled tasks:
Daemon Mode (continuous polling):
Cron Mode (single poll per invocation):
Add to your system crontab:
3. Worker Only
Run just the queue worker for processing background jobs:
Worker Options:
--queue, -Q: Queue(s) to process (comma-separated), default:default--once: Process one job then exit--stop-when-empty: Stop when no jobs available--sleep, -s: Seconds to sleep when queue empty, default:3--max-jobs, -m: Maximum jobs before stopping, default:0(unlimited)--timeout, -t: Job timeout in seconds, default:60
Queue Processing
Dispatching Jobs to Queue
Using Helper Functions
Using QueueManager Directly
Creating Queued Jobs
Same as scheduled jobs - implement IJob interface:
Queue Management
Monitor Queue Status
Managing Failed Jobs
View Failed Jobs
Shows:
- Job ID
- Queue name
- Job class
- Failure timestamp
- Exception details
Retry Failed Jobs
Delete Failed Jobs
Clear Queues
Helper Functions
More Information
Learn more at neuronphp.com
All versions of jobs with dependencies
ext-json Version *
dragonmantank/cron-expression Version ^3.4
neuron-php/cli Version 0.8.*