Swoole\Coroutine\Http2\Client->isStreamExist(...)

Declaration

<?php
Swoole\Coroutine\Http2\Client->isStreamExist(int $streamId): bool

Parameters

streamId

The ID of the stream you want to check, see example section for more details.

Return

Returns true if the stream does exist and false when the stream does not.


Description

Determine whether the specified stream still exists or not.


Example

Check the main Quick Start Examples to see how the isStreamExist() method can be used in a client context.

All you need to do is pass the stream ID which can be gotten from the stats() method:

<?php

...

$currentStreamId = $client->stats('current_stream_id');

$lastStreamId = $client->stats('last_stream_id');

...

if($client->isStreamExist(currentStreamId))
{
  // ...
}

...