- 授权协议: MIT
- 开发语言: PHP
- 操作系统: 跨平台
- 软件首页: https://github.com/huyanping/async-http-php
- 软件文档: https://github.com/huyanping/async-http-php
软件介绍
async-http-php 是个异步 HTTP 客户端,机遇 crul_mulit*,系统很简单,速度非常快。
如果你想使用 ssl 或者其他来请求一个网站,你可以实现一个 task 类和 TaskInterface 接口:
date_default_timezone_set("PRC");
require dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
$async = new \Jenner\Http\Async();
$task = \Jenner\Http\Task::createGet("http://www.baidu.com");
$async->attach($task, "baidu");
$task2 = \Jenner\Http\Task::createGet("http://www.sina.com");
$async->attach($task2, "sina");
$task3 = \Jenner\Http\Task::createGet("http://www.qq.com");
$async->attach($task3, "qq");
/**
* you can do something here before receive the http responses
* eg. query data from mysql or redis.
*/
while(true){
// nonblock
if(!$async->isDone()){
echo "I am running" . PHP_EOL;
sleep(1);
continue;
}
$result = $async->execute();
print_r($result);
break;
}
/**
* or you just call execute. it will block the process until all tasks are done.
* $result = $async->execute();
* print_r($result);
*/
Lua设计与实现
codedump / 人民邮电出版社 / 2017-8 / 49.00元
本书首先介绍了Lua中的数据结构,比如通用数据是如何表示的、Lua的字符串以及表类型的实现原理,接着讨论了Lua虚拟机的实现,并且将其中重点的一些指令进行了分类讲解,最后讨论了垃圾回收、模块实现、热更新、协程等的实现原理。一起来看看 《Lua设计与实现》 这本书的介绍吧!
