DevQueue.php 808 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace App\Module\Dev\Queues;
  3. use App\Queues\BaseQueue;
  4. use Illuminate\Bus\Queueable;
  5. use Illuminate\Contracts\Queue\ShouldQueue;
  6. use Illuminate\Foundation\Bus\Dispatchable;
  7. use Illuminate\Queue\InteractsWithQueue;
  8. use Illuminate\Queue\SerializesModels;
  9. class DevQueue extends BaseQueue implements ShouldQueue
  10. {
  11. use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
  12. /**
  13. * 队列数据
  14. *
  15. * @var array
  16. */
  17. protected $data;
  18. /**
  19. * 构造函数
  20. *
  21. * @param array $data
  22. */
  23. public function __construct(array $data)
  24. {
  25. $this->data = $data;
  26. }
  27. /**
  28. * 执行队列任务
  29. */
  30. public function handle()
  31. {
  32. // 处理队列任务
  33. \Log::info('Dev队列任务执行', $this->data);
  34. }
  35. }