ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables 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

 $type
 
 $max_concurrent_tasks
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

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

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

References $max_concurrent_tasks, and $type.

26  {
27  $types = [
28  self::TYPE_SYNCHRONOUS,
29  self::TYPE_ASYNCHRONOUS
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  }

Member Function Documentation

◆ getMaxCurrentTasks()

ilBackgroundTasksSetupConfig::getMaxCurrentTasks ( )

◆ getType()

ilBackgroundTasksSetupConfig::getType ( )

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

References $type.

45  : string
46  {
47  return $this->type;
48  }

Field Documentation

◆ $max_concurrent_tasks

ilBackgroundTasksSetupConfig::$max_concurrent_tasks
protected

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

Referenced by __construct(), and getMaxCurrentTasks().

◆ $type

ilBackgroundTasksSetupConfig::$type
protected

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

Referenced by __construct(), and getType().

◆ TYPE_ASYNCHRONOUS

const ilBackgroundTasksSetupConfig::TYPE_ASYNCHRONOUS = "async"

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

◆ TYPE_SYNCHRONOUS

const ilBackgroundTasksSetupConfig::TYPE_SYNCHRONOUS = "sync"

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