bakaphp /
phalcon-api
| 1 | <?php |
||
|
0 ignored issues
–
show
Coding Style
introduced
by
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 | public function register(DiInterface $container) |
||
| 16 | {
|
||
| 17 | $container->setShared( |
||
| 18 | 'queue', |
||
| 19 | function () {
|
||
| 20 | //Connect to the queue |
||
| 21 | $queue = new Beanstalk([ |
||
| 22 | 'host' => envValue('DATA_API_BEANSTALK_HOST', '127.0.0.1'),
|
||
| 23 | 'prefix' => envValue('DATA_API_BEANSTALK_PORT', 11300),
|
||
| 24 | ]); |
||
| 25 | |||
| 26 | return $queue; |
||
| 27 | } |
||
| 28 | ); |
||
| 29 | } |
||
| 30 | } |
||
| 31 |