ILIAS  release_8 Revision v8.23
ilBackgroundTasksSetupConfig Class Reference
+ Inheritance diagram for ilBackgroundTasksSetupConfig:
+ Collaboration diagram for ilBackgroundTasksSetupConfig:

Public Member Functions

 __construct (string $type, int $max_concurrent_tasks)
 
 getType ()
 
 getMaxCurrentTasks ()
 

Data Fields

const TYPE_SYNCHRONOUS = "sync"
 
const TYPE_ASYNCHRONOUS = "async"
 

Protected Attributes

string $type
 
int $max_concurrent_tasks
 

Detailed Description

Definition at line 22 of file class.ilBackgroundTasksSetupConfig.php.

Constructor & Destructor Documentation

◆ __construct()

ilBackgroundTasksSetupConfig::__construct ( string  $type,
int  $max_concurrent_tasks 
)

Definition at line 31 of file class.ilBackgroundTasksSetupConfig.php.

References $max_concurrent_tasks, and $type.

34  {
35  $types = [
36  self::TYPE_SYNCHRONOUS,
37  self::TYPE_ASYNCHRONOUS
38  ];
39  if (!in_array($type, $types)) {
40  throw new \InvalidArgumentException(
41  "Unknown background tasks type: '$type'"
42  );
43  }
44  if ($max_concurrent_tasks < 1) {
45  throw new \InvalidArgumentException(
46  "There must be at least 1 concurrent background task."
47  );
48  }
49  $this->type = $type;
50  $this->max_concurrent_tasks = $max_concurrent_tasks;
51  }

Member Function Documentation

◆ getMaxCurrentTasks()

ilBackgroundTasksSetupConfig::getMaxCurrentTasks ( )

Definition at line 58 of file class.ilBackgroundTasksSetupConfig.php.

References $max_concurrent_tasks.

◆ getType()

ilBackgroundTasksSetupConfig::getType ( )

Definition at line 53 of file class.ilBackgroundTasksSetupConfig.php.

References $type.

53  : string
54  {
55  return $this->type;
56  }

Field Documentation

◆ $max_concurrent_tasks

int ilBackgroundTasksSetupConfig::$max_concurrent_tasks
protected

Definition at line 29 of file class.ilBackgroundTasksSetupConfig.php.

Referenced by __construct(), and getMaxCurrentTasks().

◆ $type

string ilBackgroundTasksSetupConfig::$type
protected

Definition at line 27 of file class.ilBackgroundTasksSetupConfig.php.

Referenced by __construct(), and getType().

◆ TYPE_ASYNCHRONOUS

const ilBackgroundTasksSetupConfig::TYPE_ASYNCHRONOUS = "async"

Definition at line 25 of file class.ilBackgroundTasksSetupConfig.php.

◆ TYPE_SYNCHRONOUS

const ilBackgroundTasksSetupConfig::TYPE_SYNCHRONOUS = "sync"

The documentation for this class was generated from the following file: