netflex/scheduler

4.20.0 2022-11-24 19:35 UTC

README

Stable version Build status License: MIT Contributors Downloads

[READ ONLY] Subtree split of the Netflex Scheduler component (see netflex/framework)

Use Laravels job dispatching with Netflex Scheduled Tasks API.

Setup

composer require netflex/scheduler

Configuration

.env:

QUEUE_CONNECTION=scheduler

config/queue.php:

return [

  'default' => env('QUEUE_CONNECTION', 'scheduler'),

  'connections' => [
    'scheduler' => [
      'driver' => 'netflex',
      'url' => 'https://site.domain'
    ],
  ]
];

Usage

Use it just like Laravels regular job dispathcer:

dispatch(new App\Jobs\MyJob($arguments));

The scheduler connection will then serialize this job and schedule it for later processing.

Quirks

The job wil never be executed at the exact time. It can be delayed several minutes (but usually never more than a minute). So if your job should run at 00:00:00, you should schedule it at 23:59:00.