You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
393 B
18 lines
393 B
<?php
|
|
|
|
namespace think\swoole\concerns;
|
|
|
|
use think\swoole\queue\Manager;
|
|
|
|
trait InteractsWithQueue
|
|
{
|
|
public function prepareQueue()
|
|
{
|
|
if ($this->getConfig('queue.enable', false)) {
|
|
/** @var Manager $queueManager */
|
|
$queueManager = $this->container->make(Manager::class);
|
|
|
|
$queueManager->attachToServer($this->getServer());
|
|
}
|
|
}
|
|
}
|
|
|