Пример #1
0
 /**
  * Run the watch-loop
  *
  * @param  \stdClass $oConfig
  * @param  int $iSleep
  *
  * @return $this
  *
  * @throws Exception
  */
 public function loop(\stdClass $oConfig = null, $iSleep)
 {
     if (empty($oConfig->adapter) === true) {
         throw new Exception(Exception::MISSING_TRANSPORT);
     }
     $iTime = $this->_iTimestamp;
     $this->_iTimestamp = time();
     if ($iTime === $this->_iTimestamp) {
         $this->_iTimestamp += $iSleep;
     }
     $oParallel = \parallely\Builder::build($this->_aStack, $oConfig->adapter, $oConfig->config);
     $oParallel->run(array('check' => array($iTime), 'run'));
     unset($oParallel);
     return $this;
 }
Пример #2
0
 /**
  * Get all Revision-Details
  *
  * @param  boolean $bCreateDiff [true]
  *
  * @return Aggregator
  */
 public function run($bCreateDiff = true)
 {
     foreach ($this->_aArguments['revisions'] as $sRevision) {
         $this->_aRevisions[] = $this->_oBuilder->build($this->_aArguments['config']->remote, $sRevision);
     }
     $aActions = array('read');
     if ($bCreateDiff === true) {
         $aActions[] = 'diff';
     }
     $oParallel = \parallely\Builder::build($this->_aRevisions, $this->_aArguments['config']->parallel);
     $this->_aRevisions = $oParallel->run($aActions)->get();
     unset($oParallel);
     return $this;
 }
Пример #3
0
 /**
  *
  */
 public function testTransportMissingConfig()
 {
     $this->setExpectedException('\\parallely\\Exception', \parallely\Exception::SETUP_ERROR);
     \parallely\Builder::transport('file');
 }