1 | <?php |
||
9 | class RunManager |
||
10 | { |
||
11 | /** @var string */ |
||
12 | protected $runClass; |
||
13 | |||
14 | 37 | public function __construct($runClass) |
|
18 | |||
19 | /** |
||
20 | * @return string |
||
21 | */ |
||
22 | 18 | public function getRunClass() |
|
23 | { |
||
24 | 18 | return $this->runClass; |
|
25 | } |
||
26 | |||
27 | /** |
||
28 | * @param string $runClass |
||
29 | */ |
||
30 | public function setRunClass($runClass) |
||
34 | |||
35 | /** |
||
36 | * @param \DateTime $olderThan |
||
37 | * |
||
38 | * @return int Number of archived runs pruned |
||
39 | */ |
||
40 | public function pruneArchivedRuns(\DateTime $olderThan) |
||
44 | |||
45 | public function pruneStalledRuns() |
||
49 | |||
50 | /** |
||
51 | * @param float $start |
||
52 | * @param Job|null $job |
||
53 | */ |
||
54 | 3 | public function recordHeartbeat(Run $run, $start, Job $job = null) |
|
66 | |||
67 | 1 | protected function persistRun(Run $run, $action = 'persist') |
|
68 | { |
||
69 | // To be overridden |
||
70 | 1 | } |
|
71 | |||
72 | /** |
||
73 | * @param int $count |
||
74 | */ |
||
75 | 3 | public function updateProcessed(Run $run, $count) |
|
80 | |||
81 | /** |
||
82 | * Sets up the runManager (document / entity persister) if appropriate. |
||
83 | * |
||
84 | * @param float $start |
||
85 | * @param int|null $maxCount |
||
86 | * @param int|null $duration |
||
87 | * @param int $processTimeout |
||
88 | * |
||
89 | * @return Run |
||
90 | */ |
||
91 | 3 | public function runStart($start, $maxCount = null, $duration = null, $processTimeout = null) |
|
116 | |||
117 | /** |
||
118 | * @param Run $run |
||
119 | * @param int|null $start |
||
120 | */ |
||
121 | 3 | public function runStop(Run $run, $start) |
|
131 | } |
||
132 |