Queueable.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: yunwuxin <448901948@qq.com>
  10. // +----------------------------------------------------------------------
  11. namespace think\queue;
  12. trait Queueable
  13. {
  14. /** @var string 队列名称 */
  15. public $queue;
  16. /** @var integer 延迟时间 */
  17. public $delay;
  18. /**
  19. * 设置队列名
  20. * @param $queue
  21. * @return $this
  22. */
  23. public function queue($queue)
  24. {
  25. $this->queue = $queue;
  26. return $this;
  27. }
  28. /**
  29. * 设置延迟时间
  30. * @param $delay
  31. * @return $this
  32. */
  33. public function delay($delay)
  34. {
  35. $this->delay = $delay;
  36. return $this;
  37. }
  38. }