@@ 59-74 (lines=16) @@ | ||
56 | * $lastType) : void |
|
57 | * @param int $maxSimultaneous |
|
58 | */ |
|
59 | public function __construct( |
|
60 | array $items = [], |
|
61 | callable $onSuccess = null, |
|
62 | callable $onFailure = null, |
|
63 | callable $onProgress = null, |
|
64 | callable $onStart = null, |
|
65 | $maxSimultaneous = self::NO_MAX |
|
66 | ) { |
|
67 | parent::__construct($items); |
|
68 | ||
69 | $this->onSuccess = $onSuccess; |
|
70 | $this->onFailure = $onFailure; |
|
71 | $this->onProgress = $onProgress; |
|
72 | $this->onStart = $onStart; |
|
73 | $this->maxSimultaneous = $maxSimultaneous; |
|
74 | } |
|
75 | ||
76 | /** |
|
77 | * @param callable|null $onSuccess function (Process $process, float $duration, string $last, string $lastType) : |
@@ 55-67 (lines=13) @@ | ||
52 | * function (Process $process, float $duration, string $last, string $lastType) : |
|
53 | * void |
|
54 | */ |
|
55 | public function __construct( |
|
56 | Process $process, |
|
57 | callable $onSuccess = null, |
|
58 | callable $onFailure = null, |
|
59 | callable $onProgress = null, |
|
60 | callable $onStart = null |
|
61 | ) { |
|
62 | $this->process = $process; |
|
63 | $this->onSuccess = $onSuccess; |
|
64 | $this->onFailure = $onFailure; |
|
65 | $this->onProgress = $onProgress; |
|
66 | $this->onStart = $onStart; |
|
67 | } |
|
68 | ||
69 | /** |
|
70 | * Start the process |