Deployment Queue
Deploy packages in parallel forks (if available)
Definition at line 20 of file Queue.php.
◆ __construct()
__construct |
( |
AppState |
$appState, |
|
|
LocaleResolver |
$localeResolver, |
|
|
ResourceConnection |
$resourceConnection, |
|
|
LoggerInterface |
$logger, |
|
|
DeployPackage |
$deployPackageService, |
|
|
array |
$options = [] , |
|
|
|
$maxProcesses = self::DEFAULT_MAX_PROCESSES_AMOUNT , |
|
|
|
$maxExecTime = self::DEFAULT_MAX_EXEC_TIME |
|
) |
| |
- Parameters
-
AppState | $appState | |
LocaleResolver | $localeResolver | |
ResourceConnection | $resourceConnection | |
LoggerInterface | $logger | |
DeployPackage | $deployPackageService | |
array | $options | |
int | $maxProcesses | |
int | $maxExecTime | |
Definition at line 107 of file Queue.php.
117 $this->appState = $appState;
118 $this->localeResolver = $localeResolver;
119 $this->resourceConnection = $resourceConnection;
120 $this->logger = $logger;
121 $this->deployPackageService = $deployPackageService;
122 $this->options = $options;
123 $this->maxProcesses = $maxProcesses;
124 $this->maxExecTime = $maxExecTime;
◆ __destruct()
Free resources
Protect against zombie process
- Returns
- void
Definition at line 362 of file Queue.php.
364 foreach ($this->inProgress as $package) {
365 if (pcntl_waitpid($this->getPid($package),
$status) === -1) {
366 throw new \RuntimeException(
367 'Error while waiting for package deployed: ' . $this->getPid($package) .
'; Status: ' .
$status
◆ add()
add |
( |
Package |
$package, |
|
|
array |
$dependencies = [] |
|
) |
| |
- Parameters
-
Package | $package | |
| Package[] | $dependencies |
- Returns
- bool true on success
Definition at line 132 of file Queue.php.
134 $this->packages[$package->getPath()] = [
135 'package' => $package,
136 'dependencies' => $dependencies
◆ getPackages()
◆ process()
Process jobs
- Returns
- int
Definition at line 155 of file Queue.php.
158 $this->start = $this->lastJobStarted =
time();
159 $packages = $this->packages;
160 while (count($packages) && $this->checkTimeout()) {
161 foreach ($packages as
$name => $packageJob) {
162 $this->assertAndExecute(
$name, $packages, $packageJob);
164 $this->logger->info(
'.');
166 foreach ($this->inProgress as
$name => $package) {
167 if ($this->isDeployed($package)) {
168 unset($this->inProgress[
$name]);
173 $this->awaitForAllProcesses();
175 return $returnStatus;
if(!isset($_GET['name'])) $name
◆ DEFAULT_MAX_EXEC_TIME
const DEFAULT_MAX_EXEC_TIME = 400 |
Default max execution time
Definition at line 30 of file Queue.php.
◆ DEFAULT_MAX_PROCESSES_AMOUNT
const DEFAULT_MAX_PROCESSES_AMOUNT = 4 |
Default max amount of processes
Definition at line 25 of file Queue.php.
The documentation for this class was generated from the following file:
- vendor/magento/module-deploy/Process/Queue.php