public function setRestartThreshold(int $threshold, int $sleep = 0): self
    {
        $this->restartThreshold = $threshold;
        $this->restartThresholdSleep = $sleep;

        return $this;
    }
public function setRestartThreshold(int $threshold, int $sleep = 0): self
    {
        $this->restartThreshold = $threshold;
        $this->restartThresholdSleep = $sleep;

        return $this;
    }
public function setRestartThreshold ( int $ threshold , int $ sleep = 0 ) : self { $ this -> restartThreshold = $ threshold ; $ this -> restartThresholdSleep = $ sleep ; return $ this ; }
Sets the maximum number of messages to send before re-starting the transport.

By default, the threshold is set to 100 (and no sleep at restart).

@param int $threshold The maximum number of messages (0 to disable)
@param int $sleep     The number of seconds to sleep between stopping and re-starting the transport
Sets the maximum number of messages to send before re - starting the transport .