Phosphorum\Bootstrap::initQueue PHP Method

initQueue() protected method

Queue to deliver e-mails in real-time and other tasks.
protected initQueue ( )
    protected function initQueue()
    {
        $this->di->setShared('queue', function () {
            $config = $this->getShared('config');
            $config = $config->get('beanstalk');
            if (!$config->get('enabled')) {
                return new DummyServer();
            }
            if (!($host = $config->get('host'))) {
                throw new BeanstalkException('Beanstalk is not configured');
            }
            return new Beanstalk(['host' => $host]);
        });
    }