This repository was archived by the owner on Nov 14, 2024. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwork.php
More file actions
Latest commit
30 lines (22 loc) · 793 Bytes
/
Copy pathwork.php
File metadata and controls
30 lines (22 loc) · 793 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
/**
* Copyright (C) 2018 Michael Milawski - All Rights Reserved
* You may use, distribute and modify this code under the
* terms of the MIT license.
*/
namespaceMillsoft\Queuer;
/*
* Worker script
* This script will handle every single job.
* This will be called multiple of times, even in parallel
*/
//make the app run forever, each job can decide how long a job should run by providing the "timeout" value.
set_time_limit(0);
require_once__DIR__ . "/src/init.php";
//This worker accepts the -j or --job parameter with the job id.
$short_options = "j::";
$long_options = ["job::"];
$options = getopt($short_options, $long_options);
$job_id = isset($options['job']) ? $options['job'] : (isset($options['j']) ? $options['j'] : null);
//Run the worker
newWorker($job_id);