addBackgroundJob
public \Bitrix\Main\Application::addBackgroundJob( callable $job, array $args = [], int $priority );
Method adds a background job, executed after passing content to browser. Non-static method.
Parameters
Parameter | Type | Description | Version |
---|---|---|---|
$job | сallable | What to call. | |
$args | array | Array with parameters to call $job. | |
$priority | int | Job priority. Default value: \Bitrix\Main\Application::JOB_PRIORITY_NORMAL .
Priority values, available in class Application:
|
Example
Adding a check and agent launch (CAgent::CheckAgents()) in the background job.
\Bitrix\Main\Application::getInstance()->addBackgroundJob( ["CAgent", "CheckAgents"], [], \Bitrix\Main\Application::JOB_PRIORITY_LOW );
© «Bitrix24», 2001-2024