PHP code example of soyuka / symfony-messenger-redis

1. Go to this page and download the library: Download soyuka/symfony-messenger-redis 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/ */

    

soyuka / symfony-messenger-redis example snippets




namespace App\MessageHandler;

use App\Message\Foo;

final class FooHandler
{
    public function __invoke(Foo $message)
    {
    }
}


$bus->dispatch(new Foo());
yaml
redis_messenger_adapter:
    redis:
        url: '127.0.0.1'
        port: 6379
        serializer: !php/const \Redis::SERIALIZER_IGBINARY # default is \Redis::SERIALIZER_PHP
    messages:
        'App\Message\Foo': 'foo_queue'
        'App\Message\Bar':
            queue: 'bar_queue'
            ttl: 10000
            blockingTimeout: 1000