async_queue.php 878 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * This file is part of Hyperf.
  5. *
  6. * @link https://www.hyperf.io
  7. * @document https://hyperf.wiki
  8. * @contact group@hyperf.io
  9. * @license https://github.com/hyperf/hyperf/blob/master/LICENSE
  10. */
  11. /**
  12. * 多个队列名,就要创建多个 App\Process\AsyncQueue[xxxxxx]ConsumerProcess
  13. */
  14. $queuePrefix = env('APP_NAME', 'app2022') . ':' . env('SERVER_CACHE_PREFIX', 'cache2023') . 'job_queue';
  15. return [
  16. // App\Process\AsyncQueueDefaultConsumerProcess 在消费
  17. 'default' => [
  18. 'driver' => Hyperf\AsyncQueue\Driver\RedisDriver::class,
  19. 'redis' => [
  20. 'pool' => 'default',
  21. ],
  22. 'channel' => $queuePrefix,
  23. 'timeout' => 2,
  24. 'retry_seconds' => 5,
  25. 'handle_timeout' => 10,
  26. 'processes' => 1,
  27. 'concurrent' => [
  28. 'limit' => 10,
  29. ],
  30. ],
  31. ];