PHP Classes

File: src/Examples/job.php

Recommend this page to a friend!
  Classes of Chun-Sheng, Li   Scheduler   src/Examples/job.php   Download  
File: src/Examples/job.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Scheduler
Queue jobs to be executed by worker tasks
Author: By
Last change:
Date: 2 months ago
Size: 601 bytes
 

Contents

Class file image Download
<?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',
    ]
]);