public function readStream() : \Generator
	{
		$this->connect();

		$status = '';
		while (!$this->eof()) {
			$chunkSize = $this->readNextChunkSize();

			if ($this->isEmptyChunk($chunkSize)) {
				continue;
			}

			$chunk = $this->readChunk($chunkSize);
			$status .= $chunk;

			if ($this->isJsonFinished($chunk, $chunkSize)) {
				if ($this->isMessage($status)) {
					$this->handleMessage($status);
				} else {
					yield $status;
				}

				$status = '';
			}
		}

		$this->close();
	}
public function readStream() : \Generator
	{
		$this->connect();

		$status = '';
		while (!$this->eof()) {
			$chunkSize = $this->readNextChunkSize();

			if ($this->isEmptyChunk($chunkSize)) {
				continue;
			}

			$chunk = $this->readChunk($chunkSize);
			$status .= $chunk;

			if ($this->isJsonFinished($chunk, $chunkSize)) {
				if ($this->isMessage($status)) {
					$this->handleMessage($status);
				} else {
					yield $status;
				}

				$status = '';
			}
		}

		$this->close();
	}
public function readStream ( ) : \ Generator { $ this -> connect ( ) ; $ status = '' ; while ( ! $ this -> eof ( ) ) { $ chunkSize = $ this -> readNextChunkSize ( ) ; if ( $ this -> isEmptyChunk ( $ chunkSize ) ) { continue ; } $ chunk = $ this -> readChunk ( $ chunkSize ) ; $ status .= $ chunk ; if ( $ this -> isJsonFinished ( $ chunk , $ chunkSize ) ) { if ( $ this -> isMessage ( $ status ) ) { $ this -> handleMessage ( $ status ) ; } else { yield $ status ; } $ status = '' ; } } $ this -> close ( ) ; }
Connects to the Twitter API and starts reading the stream.

When it recieves a new status it will be passed on to the @link self::enqueueStatus() method.

@return \Generator
Connects to the Twitter API and starts reading the stream .