ocramius / ocra-hop-hop
This package is abandoned and no longer maintained.
No replacement package was suggested.
Very fast worker-based HTTP Request dispatching for ZF2 that re-uses bootstrapped applications
dev-master
2014-01-20 23:05 UTC
Requires
- react/react: 0.2.*
- zendframework/zend-mvc: 2.*
This package is auto-updated.
Last update: 2022-02-01 12:22:26 UTC
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.php
with theexamples/zf2-server.php
that you can find in OcraHopHop. - Copy
examples/zf2-worker.php
to yourpublic/
dir - Open a terminal,
cd
to yourpublic/
dir and runphp zf2-worker.php
- Run
siege
orab -k
against your ZF application - ...?
- Profit!