httpClient

属性

HttpClientInterface  $httpClient

含义

http客户端,默认使用Guzzle作为http客户端。

扩展

//自定义http客户端
$worker->bindHttpClient(function(){
    //在这里实现自定义http客户端
    //注意必须实现对应的 HttpClientInterface 接口
    //关于接口说明详见 "附录指南 --> 接口原型" 章节
}, $args1, ..., $argsN);

举栗

$worker->httpClient->setConnectTimeout(10);

results matching ""

    No results matching ""