PHP code example of tourze / symfony-async-message-bundle

1. Go to this page and download the library: Download tourze/symfony-async-message-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/ */

    

tourze / symfony-async-message-bundle example snippets


return [
    // ...
    Tourze\Symfony\AsyncMessage\AsyncMessageBundle::class => ['all' => true],
];

use Tourze\Symfony\AsyncMessage\Message\RunCommandMessage;

$message = new RunCommandMessage();
$message->setCommand('your:command');
$message->setOptions([
    '--option1' => 'value1',
    '--option2' => 'value2'
]);

$this->messageBus->dispatch($message, [
    new AsyncStamp()
]);

return [
    // ...
    Tourze\Symfony\AsyncMessage\AsyncMessageBundle::class => ['all' => true],
];

use Tourze\Symfony\AsyncMessage\Message\RunCommandMessage;

$message = new RunCommandMessage();
$message->setCommand('your:command');
$message->setOptions([
    '--option1' => 'value1',
    '--option2' => 'value2'
]);

$this->messageBus->dispatch($message, [
    new AsyncStamp()
]);