作者 竞泽

docs:async

正在显示 1 个修改的文件 包含 53 行增加1 行删除
... ... @@ -46,9 +46,61 @@ composer require lackoxygen/exception-push
```
# 使用方法
# 配置发布
```php
php artisan vendor:publish --provider=Lackoxygen\\ExceptionPush\\ExceptionPushProvider
```
# 同步
```
none
```
# 异步
```php
namespace App\Jobs;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Lackoxygen\ExceptionPush\Dispatcher;
class Send implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
/**
* Create a new job instance.
*
* @return void
*/
public function __construct($agents, $body)
{
$this->agents = $agents;
$this->body = $body;
}
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
$dis = new Dispatcher();
$func = $dis->default();
$func($this->agents, $this->body);
}
}
```
... ...