PHP code example of litgroup / event-loop-bundle

1. Go to this page and download the library: Download litgroup/event-loop-bundle 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/ */

    

litgroup / event-loop-bundle example snippets


 // AppKernel.php

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            // ...
            new LitGroup\Bundle\EventLoopBundle\LitGroupEventLoopBundle(),
        ];
        // ...

        return $bundles;
    }
 	
    // ...   
}

/** @var \React\EventLoop\LoopInterface $loop */
$loop = $container->get('litgroup_event_loop');

$loop->run();



class PeriodicService
{
	public function tick()
	{
		echo "Tick!";
    }
}