Closed butschster closed 1 year ago
<?php declare(strict_types=1); use Spiral\RoadRunner\Jobs\Queue\MemoryCreateInfo; use Spiral\RoadRunner\Jobs\Queue\AMQPCreateInfo; use Spiral\RoadRunner\Jobs\Queue\BeanstalkCreateInfo; use Spiral\RoadRunner\Jobs\Queue\SQSCreateInfo; return [ /** * Default queue connection name */ 'default' => env('QUEUE_CONNECTION', 'sync'), /** * Aliases for queue connections, if you want to use domain specific queues */ 'aliases' => [ // 'mail-queue' => 'roadrunner', // 'rating-queue' => 'sync', ], /** * Queue connections * Drivers: "sync", "roadrunner" */ 'connections' => [ 'sync' => [ // Job will be handled immediately without queueing 'driver' => 'sync', ], 'roadrunner' => [ 'driver' => 'roadrunner', 'pipeline' => 'local', ], ], 'pipelines' => [ 'local' => [ 'connector' => new MemoryCreateInfo('local'), // Run consumer for this pipeline on startup (by default) // You can pause consumer for this pipeline via console command // php app.php queue:pause local 'consume' => true ], // 'amqp' => [ // 'connector' => new AMQPCreateInfo('bus', ...), // // Don't consume jobs for this pipeline on start // // You can run consumer for this pipeline via console command // // php app.php queue:resume local // 'consume' => false // ], // // 'beanstalk' => [ // 'connector' => new BeanstalkCreateInfo('bus', ...), // ], // // 'sqs' => [ // 'connector' => new SQSCreateInfo('amazon', ...), // ], ], 'driverAliases' => [ 'sync' => \Spiral\Queue\Driver\SyncDriver::class, 'roadrunner' => \Spiral\RoadRunnerBridge\Queue\Queue::class, ], 'registry' => [ 'handlers' => [], 'serializers' => [ \Spiral\Queue\Job\ObjectJob::class => 'json', \App\Job\TestJob::class => 'serializer', \App\Job\OtherJob::class => CustomSerializer::class, \App\Job\FooJob::class => new CustomSerializer(), \App\Job\BarJob::class => new \Spiral\Core\Container\Autowire(CustomSerializer::class), ] ], ];