Documentation

Connection
in package
implements ConnectionInterface uses ConfigMethods

Table of Contents

Interfaces

ConnectionInterface

Methods

__construct()  : mixed
初始化连接
channel()  : Channel|null
获取一个可用通道
channels()  : array<string|int, Channel>
获取所有通道
consume()  : void
消费消息
disconnect()  : void
关闭连接
getClient()  : AbstractClient
获取原始rabbitmq-client
getConfig()  : mixed
getConfigs()  : array<string|int, mixed>
heartbeat()  : void
发送心跳
isConnected()  : bool
是否已连接
publish()  : mixed
发布消息
reconnect()  : void
连接/重连
setConfig()  : void

Methods

__construct()

初始化连接

public __construct(array<string|int, mixed> $config, string $name[, LoggerInterface|null $logger = null ]) : mixed
Parameters
$config : array<string|int, mixed>
$name : string
$logger : LoggerInterface|null = null

channel()

获取一个可用通道

public channel() : Channel|null
Tags
inheritDoc
Return values
Channel|null

channels()

获取所有通道

public channels() : array<string|int, Channel>
Tags
inheritDoc
Return values
array<string|int, Channel>

disconnect()

关闭连接

public disconnect([array<string|int, mixed> $options = [] ]) : void
Parameters
$options : array<string|int, mixed> = []
Tags
inheritDoc

getConfig()

public getConfig(string $key, mixed $default) : mixed
Parameters
$key : string
$default : mixed

getConfigs()

public getConfigs() : array<string|int, mixed>
Return values
array<string|int, mixed>

heartbeat()

发送心跳

public heartbeat() : void
Tags
inheritDoc

isConnected()

是否已连接

public isConnected() : bool
Return values
bool

reconnect()

连接/重连

public reconnect([array<string|int, mixed> $options = [] ][, bool $force = false ]) : void
Parameters
$options : array<string|int, mixed> = []
$force : bool = false

强制重连

Tags
inheritDoc

setConfig()

public setConfig(array<string|int, mixed> $config) : void
Parameters
$config : array<string|int, mixed>

        
On this page

Search results