ILIAS  trunk Revision v11.0_alpha-1731-gff9cd7e2bd3
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 21 of file class.ilBackgroundTasksSetupConfig.php.

Constructor & Destructor Documentation

◆ __construct()

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

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

References $max_concurrent_tasks, and $type.

33  {
34  $types = [
35  self::TYPE_SYNCHRONOUS,
36  self::TYPE_ASYNCHRONOUS
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  }

Member Function Documentation

◆ getMaxCurrentTasks()

ilBackgroundTasksSetupConfig::getMaxCurrentTasks ( )

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

References $max_concurrent_tasks.

◆ getType()

ilBackgroundTasksSetupConfig::getType ( )

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

References $type.

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

Field Documentation

◆ $max_concurrent_tasks

int ilBackgroundTasksSetupConfig::$max_concurrent_tasks
protected

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

Referenced by __construct(), and getMaxCurrentTasks().

◆ $type

string ilBackgroundTasksSetupConfig::$type
protected

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

Referenced by __construct(), and getType().

◆ TYPE_ASYNCHRONOUS

const ilBackgroundTasksSetupConfig::TYPE_ASYNCHRONOUS = "async"

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

◆ TYPE_SYNCHRONOUS

const ilBackgroundTasksSetupConfig::TYPE_SYNCHRONOUS = "sync"

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