Last Updated | | Ratings | | Unique User Downloads | | Download Rankings |
2024-07-07 (3 months ago) | | Not yet rated by the users | | Total: 34 | | All time: 11,027 This week: 43 |
|
Description | | Author |
This package can queue jobs to be executed by worker tasks.
It uses the Laravel Illuminate queue class to add jobs to a queue to be executed with given parameter details.
The queue can management is done by any driver class supported by the queue class, like, beanstalkd.
A monitor class can be passed to get events of the job processing steps.
The worker script can pull queued jobs and execute the pending jobs until the queue is empty. | |
|
|
Innovation award
Nominee: 17x
Winner: 1x |
|
Example
<?php
require_once __DIR__.'/../../vendor/autoload.php';
require_once __DIR__.'/../Loader.php';
use Illuminate\Queue\Capsule\Manager as Queue;
use peter\Scheduler\Loader;
use peter\Scheduler\WeatherJob;
use peter\Scheduler\MonitorJob;
// Make this Capsule instance available globally via static methods... (optional)
$queue = Loader::loadDriver();
$queue->setAsGlobal();
//Queue::push(WeatherJob::class, ['email' => 'masnun@gmail.com']);
Queue::push(MonitorJob::class, ['email' => 'masnun@gmail.com',
'urls' => [
'peter279k.com.tw',
'www.goo.com',
'12345678',
]
]);
|
Details
Introduction
The `
job.php`
is the sample code for calling two jobs.
The `
WeatherJob`
and `
MonitorJob`
.There are all in the `
src`
folder.
Create the jobs
If you want to create your own job, you can create the `
YourJob`
class in `
YourJob.php`
file and put it in the `
src`
folder.
And Remember to add the `
require_once __DIR__.'/WeatherJob.php';`
in `
worker.php`
.
You have to notice that the namespace so you need to set the right namespace in `
YourJob.php`
and `
job.php`
.
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.