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); } }
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; } } }