PHP code example of romanfedorskij / message-bus-spiral

1. Go to this page and download the library: Download romanfedorskij/message-bus-spiral 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/ */

    

romanfedorskij / message-bus-spiral example snippets




declare(strict_types=1);

use Wolfcharaa\MessageBus\Flow\FlowDefinition;
use Wolfcharaa\MessageBus\Registry\MessageRegistryCompilerOptions;
use Wolfcharaa\MessageBus\Spiral\Application\Job\QueueHandlerJob;

return [
    'registryFile' => directory('runtime') . 'cache/message_bus_registry.php',
    'queueJob' => QueueHandlerJob::class,
    'runtimePlan' => true,
    'compilerOptions' => new MessageRegistryCompilerOptions(failOnWarning: false),
    'flows' => [
        FlowDefinition::sync('default'),
        FlowDefinition::sync('domain_capability'),
    ],
];

use Wolfcharaa\MessageBus\Flow\FlowDefinition;
use Wolfcharaa\MessageBus\Flow\FlowRegistry;

$flows = new FlowRegistry(
    FlowDefinition::sync('default'),
    FlowDefinition::async('notifications')
        ->transport('roadrunner', 'notifications'),
);

\Wolfcharaa\MessageBus\Spiral\Application\Job\QueueHandlerJob::class