InteractsWithQueue.php 393 B

12345678910111213141516171819
  1. <?php
  2. namespace think\swoole\concerns;
  3. use think\swoole\queue\Manager;
  4. trait InteractsWithQueue
  5. {
  6. public function prepareQueue()
  7. {
  8. if ($this->getConfig('queue.enable', false)) {
  9. /** @var Manager $queueManager */
  10. $queueManager = $this->container->make(Manager::class);
  11. $queueManager->attachToServer($this->getServer());
  12. }
  13. }
  14. }