83 public function __construct($rate, $mode = self::BYTES_PER_MINUTE,
88 $this->_sleeper = $sleeper;
89 $this->_timer = $timer;
99 if (!isset($this->_start))
101 $this->_start = $time;
105 if (self::BYTES_PER_MINUTE == $this->_mode)
116 $this->
sleep($sleep);
126 parent::sendPerformed($evt);
136 if (isset($this->_sleeper))
138 $this->_sleeper->sleep($seconds);
152 if (isset($this->_timer))
154 return $this->_timer->getTimestamp();
172 $expectedDuration = $this->
getBytesOut() / ($this->_rate / 60);
173 return (
int) ceil($expectedDuration - $timePassed);
184 $expectedDuration = $this->_messages / ($this->_rate / 60);
185 return (
int) ceil($expectedDuration - $timePassed);