React适配器amphp/react-adapter使任何库与兼容。
安装composerrequireamphp/react-adapter用法在ReactPHP库需要LoopInterface实例的LoopInterface,只需传递ReactAdapter::get()即可在Amp的事件循环上运行ReactPHP库。
<?phprequire'vendor/autoload.php';useAmp\Loop;useAmp\ReactAdapter\ReactAdapter;Loop::run(function(){$app=function($request,$response){$response->writeHead(200,array('Content-Type'=>'text/plain'));$response->end("HelloWorld\n");};$socket=ne
1