OcraHopHop
:train2: Worker-based HTTP request dispatching module for ZF2
Install / Use
/learn @Ocramius/OcraHopHopREADME
OcraHopHop - Worker thread HTTP response dispatching for ZF2
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!
Related Skills
node-connect
346.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
346.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
346.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
