1. Go to this page and download the library: Download devnullius/yii2-queue-addon 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/ */
devnullius / yii2-queue-addon example snippets
use devnullius\queue\addon\bootstrap\SetUp as QueueAddonSetUp;
'bootstrap' => [
'queue',
QueueAddonSetUp::class
]
use devnullius\queue\addon\dispatchers\SimpleEventDispatcher;
use yii\di\Container;
use devnullius\queue\addon\example\TestExampleEvent;
use devnullius\queue\addon\example\TestExampleListener;
$container->setSingleton(SimpleEventDispatcher::class,
static function (Container $container) {
return new SimpleEventDispatcher($container, [
TestExampleEvent::class => [TestExampleListener::class],
]);
});
use devnullius\queue\addon\example\TestEventService;
$testService = Yii::createObject(TestEventService::class);
$testService->testEvent('Event generation no ... ');
php composer.phar
php yii queue/listen --verbose
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.