php的异步http请求类
使用示例
如下,在request的时候能够定义请求完成之后的callback函数。
$base = event_base_new();
$uri = "http://www.baidu.com/";
$config = array(
'eventbase' => $base
);
for($i = 0; $i
$client = new AsyncHttpClient($uri, $config);
$client->request(function($result) {
echo "Result len:";
echo strlen($result['response']);
// parse response with Zend_Http_Response
$response = Zend_Http_Response::fromString($result['response']);
echo $response->getBody();
echo "\n";
});
}
event_base_loop($base);
echo "done\n";
?>
目前的实现比较初级,只做了get方法的封装,如果需要http上传或者post,还需要另外实现。另外这个类也需要php的libevent扩展。

熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

AI Hentai Generator
免費產生 AI 無盡。

熱門文章

熱工具

記事本++7.3.1
好用且免費的程式碼編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發環境

Dreamweaver CS6
視覺化網頁開發工具

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)