TestJob.php 893 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace App\Module\GameItems\Jobs;
  3. use App\Module\Test\Models\Test;
  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. /**
  10. * 测试队列任务类
  11. *
  12. * 用于测试和调试目的的队列任务类。
  13. * 此类主要在开发阶段使用,用于测试队列系统的功能。
  14. * 不建议在生产环境中使用此队列任务类。
  15. */
  16. class TestJob implements ShouldQueue
  17. {
  18. use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
  19. /**
  20. * 创建任务实例
  21. *
  22. * @param Test $test
  23. */
  24. public function __construct(protected Test $test)
  25. {
  26. }
  27. /**
  28. * 执行任务
  29. *
  30. * @return void
  31. */
  32. public function handle(): void
  33. {
  34. // 任务处理逻辑
  35. }
  36. }