Example #1
0
 public function resume(SpoutInterface $spout)
 {
     if (!$this->start) {
         $this->start = new \DateTime();
         $spout->push($this->bubble);
     } elseif ($this->start->diff(new \DateTime())->s > $this->throttle) {
         $this->start = new \DateTime();
         $spout->push($this->bubble);
     }
 }
Example #2
0
 public function resume(SpoutInterface $spout)
 {
     if (!$this->enabled) {
         if (!$this->start) {
             $this->start = new \DateTime();
         } elseif ($this->start->diff(new \DateTime())->s > $this->delay) {
             $spout->push($this->bubble);
             $this->enabled = true;
         }
     }
 }
Example #3
0
 public function resume(\bubblr\Spout\SpoutInterface $spout)
 {
     foreach ($this->bubbles as $k => $bubble) {
         if (!$bubble instanceof BubbleInterface) {
             $bubble = $this->bubbles[$k] = $spout->getBubbler()->getAdapter()->execute($this, $bubble);
         }
         $bubble->resume($spout);
         if ($bubble->isComplete()) {
             if ($bubble->isFailure()) {
                 $this->exceptions[] = $bubble->getException();
             } elseif ($bubble->isCanceled()) {
                 $this->exceptions[] = new BubbleCanceledException($bubble);
             } else {
                 $this->results[] = $bubble->getResult();
             }
         }
     }
 }
Example #4
0
 public function suspend(SpoutInterface $spout)
 {
     $spout->suspend();
 }
Example #5
0
 public function suspend()
 {
     return $this->spout->suspend();
 }