1. Go to this page and download the library: Download vxm/yii2-async 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/ */
vxm / yii2-async example snippets
[
'components' => [
'async' => [
'class' => 'vxm\async\Async',
'appConfigFile' => '@app/config/async.php' // optional when you need to use yii feature in async process.
]
]
]
use vxm\async\Task;
class MyTask extends Task
{
public $productId;
public function run()
{
// Do the real work here.
}
}
// Do task async use like an anonymous above.
Yii::$app->async->run(new MyTask([
'productId' => 123
]));
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.