ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilBackgroundTasksSetupConfig.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 2019 Richard Klees <richard.klees@concepts-and-training.de> Extended GPL, see docs/LICENSE */
4
7
9{
10 const TYPE_SYNCHRONOUS = "sync";
11 const TYPE_ASYNCHRONOUS = "async";
12
16 protected $type;
17
22
23 public function __construct(
24 string $type,
26 ) {
27 $types = [
30 ];
31 if (!in_array($type, $types)) {
32 throw new \InvalidArgumentException(
33 "Unknown background tasks type: '$type'"
34 );
35 }
36 if ($max_concurrent_tasks < 1) {
37 throw new \InvalidArgumentException(
38 "There must be at least 1 concurrent background task."
39 );
40 }
41 $this->type = $type;
42 $this->max_concurrent_tasks = $max_concurrent_tasks;
43 }
44
45 public function getType() : string
46 {
47 return $this->type;
48 }
49
50 public function getMaxCurrentTasks() : int
51 {
53 }
54}
An exception for terminatinating execution or to throw for unit testing.
A password is used as part of credentials for authentication.
Definition: Password.php:14
__construct(string $type, int $max_concurrent_tasks)
A configuration for the setup.
Definition: Config.php:11
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...