ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilBackgroundTasksSetupConfig.php
Go to the documentation of this file.
1<?php
2
20
22{
23 public const TYPE_SYNCHRONOUS = "sync";
24 public const TYPE_ASYNCHRONOUS = "async";
25
26 protected string $type;
27
28 protected int $max_concurrent_tasks;
29
30 public function __construct(
31 string $type,
33 ) {
34 $types = [
37 ];
38 if (!in_array($type, $types)) {
39 throw new \InvalidArgumentException(
40 "Unknown background tasks type: '$type'"
41 );
42 }
43 if ($max_concurrent_tasks < 1) {
44 throw new \InvalidArgumentException(
45 "There must be at least 1 concurrent background task."
46 );
47 }
48 $this->type = $type;
49 $this->max_concurrent_tasks = $max_concurrent_tasks;
50 }
51
52 public function getType(): string
53 {
54 return $this->type;
55 }
56
57 public function getMaxCurrentTasks(): int
58 {
60 }
61}
__construct(string $type, int $max_concurrent_tasks)
A configuration for the setup.
Definition: Config.php:27