webCOMAND

COMAND Tasks

io_comand_systemtask

Provides features for launching and monitoring background tasks.

Adding and scheduling tasks generally involves the following components.

  • Task - This may be PHP code or a command-line interface (CLI) script or application.
  • Runnable - A simple repository object that identifies the Task and what type it is (PHP or CLI).
  • Scheduled Task - A repository object that identifies the Runnable and when and how to run it.

Add a Task

  • CLI Tasks - Schedule a CLI app or daemon to run periodically and monitor it while running.
  • PHP Tasks - Schedule a PHP app or daemon to run periodically and monitor it while running.

System Task

The System Task primarily contributes the System Task and Scheduled Task models, which can be used to start, monitor and review tasks.

Example

$repo = comand::repo();
$task = $repo->get('ScheduledTask WHERE OID=123');
$task->start();