public static multiGroupOneForOne ( $configs ) : |
||
return |
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);
}
public function testMultiGroupOneForOne_CreateKeeper() { Supervisor::multiGroupOneForOne(array(array('worker' => function () { exit; }), array('worker' => function () { exit; }), array('worker' => function () { exit; }, 'quantity' => 3, 'maxRestartTimes' => 3))); }