/
DefaultAsyncConnection.php
44 lines (36 loc) · 1.05 KB
/
DefaultAsyncConnection.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
namespace Concrete\Core\Messenger\Transport\DefaultAsync;
use Symfony\Component\Messenger\Bridge\Doctrine\Transport\Connection as DoctrineTransportConnection;
use Concrete\Core\Application\Application;
use Doctrine\DBAL\Connection as DoctrineConnection;
/**
* A decorator for the default Doctrine Transport Connection.
*/
class DefaultAsyncConnection
{
/**
* @var Application
*/
protected $app;
/**
* @var DoctrineTransportConnection
*/
protected $wrappedConnection;
public function __construct(Application $app)
{
$this->app = $app;
$this->wrappedConnection = new DoctrineTransportConnection([
'table_name' => 'MessengerMessages',
'queue_name' => 'default',
'redeliver_timeout' => 3600,
'auto_setup' => true,
], $app->make(DoctrineConnection::class));
}
/**
* @return DoctrineTransportConnection
*/
public function getWrappedConnection(): DoctrineTransportConnection
{
return $this->wrappedConnection;
}
}