ocramius/ocra-hop-hop
Composer 安装命令:
composer require ocramius/ocra-hop-hop
包简介
Very fast worker-based HTTP Request dispatching for ZF2 that re-uses bootstrapped applications
README 文档
README
OcraHopHop is a project aimed at reducing latency and resources used by a ZF2 Application while dispatching an HTTP Request.
Installation
The recommended way to install ocramius/ocra-hop-hop is through
composer:
{
"require": {
"ocramius/ocra-hop-hop": "dev-master@dev"
}
}
Working concept
The concept behind OCraHopHop is simple, and can be summarized in following pseudo code:
init_autoload(); init_config(); // ... init_application(); while ($request = get_http_request()) { $application->serve($request); }
The idea is to avoid initialization logic by re-using resources across multiple requests.
PHP was thought for share-nothing architectures, but for greater and more complex applications, such an approach is necessary.
If you already know FastCGI, this is what it is all about.
Usage
- Replace your
public/index.phpwith theexamples/zf2-server.phpthat you can find in OcraHopHop. - Copy
examples/zf2-worker.phpto yourpublic/dir - Open a terminal,
cdto yourpublic/dir and runphp zf2-worker.php - Run
siegeorab -kagainst your ZF application - ...?
- Profit!
统计信息
- 总下载量: 19
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 27
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2012-11-25