queue.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <?php
  2. declare(strict_types=1);
  3. return [
  4. /*
  5. |--------------------------------------------------------------------------
  6. | Default Queue Connection Name
  7. |--------------------------------------------------------------------------
  8. |
  9. | Hypervel's queue supports a variety of backends via a single, unified
  10. | API, giving you convenient access to each backend using identical
  11. | syntax for each. The default queue connection is defined below.
  12. |
  13. */
  14. 'default' => env('QUEUE_CONNECTION', 'database'),
  15. /*
  16. |--------------------------------------------------------------------------
  17. | Concurrency Number
  18. |--------------------------------------------------------------------------
  19. |
  20. | This value determines the number of jobs that will be processed at once
  21. | by every worker.
  22. |
  23. */
  24. 'concurrency_number' => env('QUEUE_CONCURRENCY_NUMBER', 1),
  25. /*
  26. |--------------------------------------------------------------------------
  27. | Queue Connections
  28. |--------------------------------------------------------------------------
  29. |
  30. | Here you may configure the connection options for every queue backend
  31. | used by your application. An example configuration is provided for
  32. | each backend supported by Hypervel. You're also free to add more.
  33. |
  34. | Drivers: "sync", "defer", "database", "beanstalkd", "sqs", "redis", "null"
  35. |
  36. */
  37. 'connections' => [
  38. 'sync' => [
  39. 'driver' => 'sync',
  40. ],
  41. 'defer' => [
  42. 'driver' => 'defer',
  43. ],
  44. 'database' => [
  45. 'driver' => 'database',
  46. 'connection' => env('DB_QUEUE_CONNECTION'),
  47. 'table' => env('DB_QUEUE_TABLE', 'jobs'),
  48. 'queue' => env('DB_QUEUE', 'default'),
  49. 'retry_after' => (int) env('DB_QUEUE_RETRY_AFTER', 90),
  50. 'after_commit' => false,
  51. ],
  52. 'beanstalkd' => [
  53. 'driver' => 'beanstalkd',
  54. 'host' => env('BEANSTALKD_QUEUE_HOST', 'localhost'),
  55. 'queue' => env('BEANSTALKD_QUEUE', 'default'),
  56. 'retry_after' => (int) env('BEANSTALKD_QUEUE_RETRY_AFTER', 90),
  57. 'block_for' => 0,
  58. 'after_commit' => false,
  59. 'pool' => [
  60. 'min_objects' => 1,
  61. 'max_objects' => 10,
  62. 'wait_timeout' => 3.0,
  63. 'max_lifetime' => 60.0,
  64. ],
  65. ],
  66. 'sqs' => [
  67. 'driver' => 'sqs',
  68. 'key' => env('AWS_ACCESS_KEY_ID'),
  69. 'secret' => env('AWS_SECRET_ACCESS_KEY'),
  70. 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
  71. 'queue' => env('SQS_QUEUE', 'default'),
  72. 'suffix' => env('SQS_SUFFIX'),
  73. 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
  74. 'after_commit' => false,
  75. 'pool' => [
  76. 'min_objects' => 1,
  77. 'max_objects' => 10,
  78. 'wait_timeout' => 3.0,
  79. 'max_lifetime' => 60.0,
  80. ],
  81. ],
  82. 'redis' => [
  83. 'driver' => 'redis',
  84. 'connection' => env('REDIS_QUEUE_CONNECTION', 'default'),
  85. 'queue' => env('REDIS_QUEUE', 'default'),
  86. 'retry_after' => (int) env('REDIS_QUEUE_RETRY_AFTER', 90),
  87. 'block_for' => null,
  88. 'after_commit' => false,
  89. ],
  90. ],
  91. /*
  92. |--------------------------------------------------------------------------
  93. | Job Batching
  94. |--------------------------------------------------------------------------
  95. |
  96. | The following options configure the database and table that store job
  97. | batching information. These options can be updated to any database
  98. | connection and table which has been defined by your application.
  99. |
  100. */
  101. 'batching' => [
  102. 'database' => env('DB_CONNECTION', 'sqlite'),
  103. 'table' => 'job_batches',
  104. ],
  105. /*
  106. |--------------------------------------------------------------------------
  107. | Failed Queue Jobs
  108. |--------------------------------------------------------------------------
  109. |
  110. | These options configure the behavior of failed queue job logging so you
  111. | can control how and where failed jobs are stored. Hypervel ships with
  112. | support for storing failed jobs in a simple file or in a database.
  113. |
  114. | Supported drivers: "database-uuids", "dynamodb", "file", "null"
  115. |
  116. */
  117. 'failed' => [
  118. 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
  119. 'database' => env('DB_CONNECTION', 'sqlite'),
  120. 'table' => 'failed_jobs',
  121. ],
  122. ];