Swoole\Http\Response->isWritable

Version: Swoole: 4.6.0+

Declaration

<?php
Swoole\Http\Response->isWritable()

Parameters

Return

bool

Description

Check if a HTTP response is closed or writable.

Example

<?php
$server = new swoole_http_server('127.0.0.1', 9000, SWOOLE_BASE);
$server->on('request', function ($req, $resp) {
    var_dump($resp->isWritable());
    $resp->end('Hello swoole.co.uk');
    var_dump($resp->isWritable());
});
$server->start();