Options::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 9.7666
c 0
b 0
f 0
cc 1
nc 1
nop 6
1
<?php
2
3
namespace SfCod\QueueBundle\Worker;
4
5
/**
6
 * Class WorkerOptions
7
 *
8
 * @package SfCod\QueueBundle
9
 */
10
class Options
11
{
12
    /**
13
     * The number of seconds before a released job will be available.
14
     *
15
     * @var int
16
     */
17
    public $delay;
18
19
    /**
20
     * The maximum amount of RAM the worker may consume.
21
     *
22
     * @var int
23
     */
24
    public $memory;
25
26
    /**
27
     * The maximum number of seconds a child worker may run.
28
     *
29
     * @var int
30
     */
31
    public $timeout;
32
33
    /**
34
     * The number of seconds to wait in between polling the queue.
35
     *
36
     * @var int
37
     */
38
    public $sleep;
39
40
    /**
41
     * The maximum amount of times a job may be attempted.
42
     *
43
     * @var int
44
     */
45
    public $maxTries;
46
47
    /**
48
     * Indicates if the worker should run in maintenance mode.
49
     *
50
     * @var bool
51
     */
52
    public $force;
53
54
    /**
55
     * WorkerOptions constructor.
56
     *
57
     * @param int $delay
58
     * @param int $memory
59
     * @param int $timeout
60
     * @param int $sleep
61
     * @param int $maxTries
62
     * @param bool $force
63
     */
64
    public function __construct(
65
        int $delay = 0,
66
        int $memory = 128,
67
        int $timeout = 60,
68
        int $sleep = 3,
69
        int $maxTries = 0,
70
        bool $force = false
71
    ) {
72
        $this->delay = $delay;
73
        $this->sleep = $sleep;
74
        $this->force = $force;
75
        $this->memory = $memory;
76
        $this->timeout = $timeout;
77
        $this->maxTries = $maxTries;
78
    }
79
}
80