Comos\Qpm\Supervision\Supervisor::taskFactoryMode PHP Method

taskFactoryMode() public static method

public static taskFactoryMode ( $conf )
    public static function taskFactoryMode($conf)
    {
        $config = new Config($conf);
        return new self(new TaskFactoryKeeper($config));
    }

Usage Example

Ejemplo n.º 1
0
 public function testRun_WithTimeout_WithOnTimeout()
 {
     Supervisor::taskFactoryMode(array('quantity' => 3, 'timeout' => 1, 'onTimeout' => array($this, 'onTimeout'), 'factory' => array($this, 'fetchTask_WithSleeping')))->start();
     $content = \file_get_contents($this->logFile);
     $arr = array_filter(explode(',', $content), function ($i) {
         return $i !== '';
     });
     sort($arr);
     $this->assertEquals(array('1', '4', '5', '7', '10', '13', '14'), $arr);
     $this->assertEquals(3, \count($this->timeoutProcesses));
 }
All Usage Examples Of Comos\Qpm\Supervision\Supervisor::taskFactoryMode