PHP线程关闭错误:http/client
我使用zts php进行线程化工作我有闭包错误guzzle客户端不是序列化$this->client,我使用$client正在工作我如何添加运行函数guzzle HTTP客户端 我得到一个错误:PHP线程关闭错误:http/client,php,multithreading,class,closures,guzzlehttp,Php,Multithreading,Class,Closures,Guzzlehttp,我使用zts php进行线程化工作我有闭包错误guzzle客户端不是序列化$this->client,我使用$client正在工作我如何添加运行函数guzzle HTTP客户端 我得到一个错误: use GuzzleHttp\Client; use GuzzleHttp\Promise\EachPromise; use GuzzleHttp\TransferStats; use Psr\Http\Message\ResponseInterface; use GuzzleHttp\Promise\
use GuzzleHttp\Client;
use GuzzleHttp\Promise\EachPromise;
use GuzzleHttp\TransferStats;
use Psr\Http\Message\ResponseInterface;
use GuzzleHttp\Promise\PromiseInterface;
class check extends Thread
{
function __construct(string $url,int $timeout=60)
{
$this->client= new Client([
'timeout' => $timeout
]);
$this->timeout = $this->timeout;
}
public function run() {
$response = $this->client->request('head', "http://www.google.com", [
'on_stats' => function (TransferStats $stats) {
$this->uri = $stats->getEffectiveUri();
$this->transferTime = $stats->getTransferTime();
}
]);
}
}
Fatal error: Uncaught Exception: Serialization of 'Closure' is not allowed in