*/ public function subscribe(string $topic, string $channel, ?float $timeout = 0): Generator { $this->sub($topic, $channel); $this->rdy(1); while (true) { $message = $this->consume($timeout); if (null === $message) { if (self::STOP === yield null) { break; } continue; } if (self::STOP === yield new Envelope($message, $this)) { break; } $this->rdy(1); } $this->disconnect(); } }