示例#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);
     }
 }
示例#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;
         }
     }
 }