Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
namespace Illuminate\Queue;
4
 
5
class WorkerOptions
6
{
7
    /**
8
     * The name of the worker.
9
     *
10
     * @var int
11
     */
12
    public $name;
13
 
14
    /**
15
     * The number of seconds to wait before retrying a job that encountered an uncaught exception.
16
     *
17
     * @var int|int[]
18
     */
19
    public $backoff;
20
 
21
    /**
22
     * The maximum amount of RAM the worker may consume.
23
     *
24
     * @var int
25
     */
26
    public $memory;
27
 
28
    /**
29
     * The maximum number of seconds a child worker may run.
30
     *
31
     * @var int
32
     */
33
    public $timeout;
34
 
35
    /**
36
     * The number of seconds to wait in between polling the queue.
37
     *
38
     * @var int
39
     */
40
    public $sleep;
41
 
42
    /**
43
     * The number of seconds to rest between jobs.
44
     *
45
     * @var int
46
     */
47
    public $rest;
48
 
49
    /**
50
     * The maximum number of times a job may be attempted.
51
     *
52
     * @var int
53
     */
54
    public $maxTries;
55
 
56
    /**
57
     * Indicates if the worker should run in maintenance mode.
58
     *
59
     * @var bool
60
     */
61
    public $force;
62
 
63
    /**
64
     * Indicates if the worker should stop when the queue is empty.
65
     *
66
     * @var bool
67
     */
68
    public $stopWhenEmpty;
69
 
70
    /**
71
     * The maximum number of jobs to run.
72
     *
73
     * @var int
74
     */
75
    public $maxJobs;
76
 
77
    /**
78
     * The maximum number of seconds a worker may live.
79
     *
80
     * @var int
81
     */
82
    public $maxTime;
83
 
84
    /**
85
     * Create a new worker options instance.
86
     *
87
     * @param  string  $name
88
     * @param  int|int[]  $backoff
89
     * @param  int  $memory
90
     * @param  int  $timeout
91
     * @param  int  $sleep
92
     * @param  int  $maxTries
93
     * @param  bool  $force
94
     * @param  bool  $stopWhenEmpty
95
     * @param  int  $maxJobs
96
     * @param  int  $maxTime
97
     * @param  int  $rest
98
     * @return void
99
     */
100
    public function __construct($name = 'default', $backoff = 0, $memory = 128, $timeout = 60, $sleep = 3, $maxTries = 1,
101
                                $force = false, $stopWhenEmpty = false, $maxJobs = 0, $maxTime = 0, $rest = 0)
102
    {
103
        $this->name = $name;
104
        $this->backoff = $backoff;
105
        $this->sleep = $sleep;
106
        $this->rest = $rest;
107
        $this->force = $force;
108
        $this->memory = $memory;
109
        $this->timeout = $timeout;
110
        $this->maxTries = $maxTries;
111
        $this->stopWhenEmpty = $stopWhenEmpty;
112
        $this->maxJobs = $maxJobs;
113
        $this->maxTime = $maxTime;
114
    }
115
}