Predis\PubSub\AbstractConsumer::stop PHP Метод

stop() публичный Метод

Closes the context by unsubscribing from all the subscribed channels. The context can be forcefully closed by dropping the underlying connection.
public stop ( boolean $drop = false ) : boolean
$drop boolean Indicates if the context should be closed by dropping the connection.
Результат boolean Returns false when there are no pending messages.
    public function stop($drop = false)
    {
        if (!$this->valid()) {
            return false;
        }
        if ($drop) {
            $this->invalidate();
            $this->disconnect();
        } else {
            if ($this->isFlagSet(self::STATUS_SUBSCRIBED)) {
                $this->unsubscribe();
            }
            if ($this->isFlagSet(self::STATUS_PSUBSCRIBED)) {
                $this->punsubscribe();
            }
        }
        return !$drop;
    }