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

multiGroupOneForOne() public static method

public static multiGroupOneForOne ( $configs ) : Supervisor
return Supervisor
    public static function multiGroupOneForOne($configs)
    {
        if (!is_array($configs) and !$configs instanceof \Iterator) {
            throw new \InvalidArgumentException('exptects an array or Iterator');
        }
        if (!count($configs)) {
            throw new \InvalidArgumentException('at least 1 item');
        }
        $cs = array();
        foreach ($configs as $c) {
            $cs[] = new Config($c);
        }
        return self::_oneForOne($cs);
    }

Usage Example

コード例 #1
0
ファイル: SupervisorTest.php プロジェクト: jinchunguang/qpm
 public function testMultiGroupOneForOne_CreateKeeper()
 {
     Supervisor::multiGroupOneForOne(array(array('worker' => function () {
         exit;
     }), array('worker' => function () {
         exit;
     }), array('worker' => function () {
         exit;
     }, 'quantity' => 3, 'maxRestartTimes' => 3)));
 }
All Usage Examples Of Comos\Qpm\Supervision\Supervisor::multiGroupOneForOne