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

Latest version: pecl install openswoole-22.1.2 | composer require openswoole/core:22.1.5

Declaration

<?php OpenSwoole\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 September 1, 2022