Added PublishEvent listener connection and queue configuration feature

This commit is contained in:
2025-12-31 16:39:48 +04:00
parent 7ae585ae29
commit 739a1a6bef
11 changed files with 325 additions and 314 deletions

View File

@@ -4,23 +4,38 @@ declare(strict_types=1);
namespace Diffhead\PHP\LaravelRabbitMQ\Object;
use PhpAmqpLib\Channel\AMQPChannel;
use PhpAmqpLib\Connection\AMQPStreamConnection;
class Connection
{
public function __construct(
private AMQPStreamConnection $connection,
private AMQPChannel $channel
private string $host,
private int $port,
private string $user,
private string $password,
private string $vhost,
) {}
public function connection(): AMQPStreamConnection
public function host(): string
{
return $this->connection;
return $this->host;
}
public function channel(): AMQPChannel
public function port(): int
{
return $this->channel;
return $this->port;
}
public function user(): string
{
return $this->user;
}
public function password(): string
{
return $this->password;
}
public function vhost(): string
{
return $this->vhost;
}
}