PHP code example of react-parallel / psr-15-adapter

1. Go to this page and download the library: Download react-parallel/psr-15-adapter library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

react-parallel / psr-15-adapter example snippets


use ReactParallel\Factory as ParallelFactory;

$loop = Factory::create();
$factory = new ParallelFactory($loop);
$psr15Middleware = new ThePsr15MiddlewareOfYourChoice();
$otherPsr15Middleware = new TheOtherPsr15MiddlewareOfYourChoice();
$server = new React\Http\Server(
    $loop,
    new ReactMiddleware(
        $factory, 
        $psr15Middleware, 
        $otherPsr15Middleware
    )
);