File: Runner.php

package info (click to toggle)
php-horde-queue 1.1.5-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 120 kB
  • sloc: xml: 192; php: 148; makefile: 2
file content (26 lines) | stat: -rw-r--r-- 513 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
abstract class Horde_Queue_Runner
{
    /**
     * @var Horde_Queue_Storage
     */
    protected $_storage;

    public function __construct(Horde_Queue_Storage $storage)
    {
        $this->_storage = $storage;
    }

    abstract public function run();

    public function runTask(Horde_Queue_Task $task)
    {
        //@TODO add logging
        try {
            $task->run();
        } catch (Exception $e) {
            //@TODO TEMPORARY
            echo $e->getMessage() . "\n";
        }
    }
}