period = $option['period']; $this->cap = isset($option['cap']) ? $option['cap'] : 20000; } public function getDelayTime($ctx) { $randomTime = mt_rand(0, $ctx->getRetryCount() * $this->period); return ($randomTime > $this->cap) ? $this->cap : $randomTime; } }