Failed Conditions
Push — master ( c6c43f...4678b5 )
by Maximo
03:05
created

library/Providers/QueueProvider.php (1 issue)

1
<?php
0 ignored issues
show
End of line character is invalid; expected "\n" but found "\r\n"
Loading history...
2
3
namespace Gewaer\Providers;
4
5
use Phalcon\Di\ServiceProviderInterface;
6
use Phalcon\DiInterface;
7
use Phalcon\Queue\Beanstalk\Extended as Beanstalk;
8
use function Gewaer\Core\envValue;
9
10
class QueueProvider implements ServiceProviderInterface
11
{
12
    /**
13
     * @param DiInterface $container
14
     */
15 4
    public function register(DiInterface $container)
16
    {
17 4
        $container->setShared(
18 4
            'queue',
19
            function () {
20
                //Connect to the queue
21 1
                $queue = new Beanstalk([
22 1
                    'host' => envValue('DATA_API_BEANSTALK_HOST', '127.0.0.1'),
23 1
                    'prefix' => envValue('DATA_API_BEANSTALK_PORT', 11300),
24
                ]);
25
26 1
                return $queue;
27 4
            }
28
        );
29 4
    }
30
}
31