WorkerOptions.php 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. namespace Illuminate\Queue;
  3. class WorkerOptions
  4. {
  5. /**
  6. * The number of seconds before a released job will be available.
  7. *
  8. * @var int
  9. */
  10. public $delay;
  11. /**
  12. * The maximum amount of RAM the worker may consume.
  13. *
  14. * @var int
  15. */
  16. public $memory;
  17. /**
  18. * The maximum number of seconds a child worker may run.
  19. *
  20. * @var int
  21. */
  22. public $timeout;
  23. /**
  24. * The number of seconds to wait in between polling the queue.
  25. *
  26. * @var int
  27. */
  28. public $sleep;
  29. /**
  30. * The maximum amount of times a job may be attempted.
  31. *
  32. * @var int
  33. */
  34. public $maxTries;
  35. /**
  36. * Indicates if the worker should run in maintenance mode.
  37. *
  38. * @var bool
  39. */
  40. public $force;
  41. /**
  42. * Create a new worker options instance.
  43. *
  44. * @param int $delay
  45. * @param int $memory
  46. * @param int $timeout
  47. * @param int $sleep
  48. * @param int $maxTries
  49. * @param bool $force
  50. * @return void
  51. */
  52. public function __construct($delay = 0, $memory = 128, $timeout = 60, $sleep = 3, $maxTries = 0, $force = false)
  53. {
  54. $this->delay = $delay;
  55. $this->sleep = $sleep;
  56. $this->force = $force;
  57. $this->memory = $memory;
  58. $this->timeout = $timeout;
  59. $this->maxTries = $maxTries;
  60. }
  61. }