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

4.x is outdated, please check the latest version 22.x


Latest version: pecl install openswoole-22.1.2

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))
{
  // ...
}

...
Last updated on August 31, 2022