Documentation

Connection
in package
implements ConnectionInterface uses ConfigMethods, LoggerMethods, InitMethods, ConnectionMethods

Table of Contents

Interfaces

ConnectionInterface

Properties

$lastHeartbeatRecvTime  : float
$lastHeartbeatSendTime  : float

Methods

__construct()  : mixed
accessRequest()  : bool
send AMQP access.request frame
await()  : AbstractFrame|mixed
await - string event: pub/sub mode, ONLY RUN FIRST EVENT'S CHECKER!!! - AbstractFrame: queue mode - FIFO
channel()  : Channel
get ready channel
channelRemove()  : void
release channel
channels()  : Pool
get the channels pool
channelUsed()  : Channel|array<string|int, mixed>|null
get all used channels / get one used channel
connect()  : void
连接
connection()  : AsyncTcpConnection
init/get tcp client
connectionClose()  : bool
send AMQP connection.close frame
connectionCloseOk()  : bool
send AMQP connection.closeOk frame
connectionHeartbeat()  : bool
send AMQP connection.heartbeat frame
connectionOpen()  : bool
send AMQP connection.open frame
connectionSecureOk()  : bool
send AMQP connection.secureOk frame
connectionStartOk()  : bool
send AMQP connection.startOk frame
connectionTuneOk()  : bool
send AMQP connection.tuneOk frame
disconnect()  : void
关闭连接
frameSend()  : null|bool
send protocol frame
getChannelId()  : int
get free channel's id
getClientProperties()  : array<string|int, mixed>
getConfig()  : mixed
getConfigs()  : array<string|int, mixed>
getFrameMax()  : int
getLogger()  : LoggerInterface|null
getState()  : int
get state
id()  : string
get id
masterChannel()  : null|Channel
master channel
onFrameReceived()  : void
setConfig()  : void
setLogger()  : void
setState()  : void
set state
wakeup()  : void
wakeup

Properties

$lastHeartbeatRecvTime

public float $lastHeartbeatRecvTime = 0.0

last heartbeat receive time

$lastHeartbeatSendTime

public float $lastHeartbeatSendTime = 0.0

last heartbeat send time

Methods

__construct()

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

accessRequest()

send AMQP access.request frame

public accessRequest([string $realm = '/data' ][, bool $exclusive = false ][, bool $passive = true ][, bool $active = true ][, bool $write = true ][, bool $read = true ]) : bool

The current conventional AMQP-server broker generally do not need to handle it by themselves

Parameters
$realm : string = '/data'
$exclusive : bool = false
$passive : bool = true
$active : bool = true
$write : bool = true
$read : bool = true
Return values
bool

await()

await - string event: pub/sub mode, ONLY RUN FIRST EVENT'S CHECKER!!! - AbstractFrame: queue mode - FIFO

public await(AbstractFrame>|string $frameClassOrEvent[, callable|null $checker = null ]) : AbstractFrame|mixed
Parameters
$frameClassOrEvent : AbstractFrame>|string
$checker : callable|null = null

= function(AbstractFrame|mixed $frame): bool} DO NOT have coroutine switching in callback

Return values
AbstractFrame|mixed

channelRemove()

release channel

public channelRemove(int $channelId) : void
Parameters
$channelId : int

channels()

get the channels pool

public channels() : Pool
Return values
Pool

channelUsed()

get all used channels / get one used channel

public channelUsed([int|null $channelId = null ]) : Channel|array<string|int, mixed>|null
Parameters
$channelId : int|null = null
Return values
Channel|array<string|int, mixed>|null

connect()

连接

public connect() : void
Tags
inheritDoc

connection()

init/get tcp client

public connection() : AsyncTcpConnection
Return values
AsyncTcpConnection

connectionClose()

send AMQP connection.close frame

public connectionClose(int $replyCode, string $replyText, int $closeClassId, int $closeMethodId) : bool
Parameters
$replyCode : int
$replyText : string
$closeClassId : int
$closeMethodId : int
Return values
bool

connectionCloseOk()

send AMQP connection.closeOk frame

public connectionCloseOk() : bool
Return values
bool

connectionHeartbeat()

send AMQP connection.heartbeat frame

public connectionHeartbeat() : bool
Return values
bool

connectionOpen()

send AMQP connection.open frame

public connectionOpen([string $virtualHost = '/' ][, string $capabilities = '' ][, bool $insist = false ]) : bool
Parameters
$virtualHost : string = '/'
$capabilities : string = ''
$insist : bool = false
Return values
bool

connectionSecureOk()

send AMQP connection.secureOk frame

public connectionSecureOk(mixed $response) : bool
Parameters
$response : mixed
Return values
bool

connectionStartOk()

send AMQP connection.startOk frame

public connectionStartOk(array<string|int, mixed> $clientProperties, string $mechanism, string $response[, string $locale = 'en_US' ]) : bool
Parameters
$clientProperties : array<string|int, mixed>
$mechanism : string
$response : string
$locale : string = 'en_US'
Return values
bool

connectionTuneOk()

send AMQP connection.tuneOk frame

public connectionTuneOk([int $channelMax = 0 ][, int $frameMax = 0 ][, int $heartbeat = 0 ]) : bool
Parameters
$channelMax : int = 0
$frameMax : int = 0
$heartbeat : int = 0
Return values
bool

disconnect()

关闭连接

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

frameSend()

send protocol frame

public frameSend(AbstractFrame|Buffer $frame) : null|bool
Parameters
$frame : AbstractFrame|Buffer
Tags
inheritDoc
Return values
null|bool

getChannelId()

get free channel's id

public getChannelId() : int
Return values
int

getClientProperties()

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

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>

getFrameMax()

public getFrameMax() : int
Return values
int

getLogger()

public getLogger() : LoggerInterface|null
Return values
LoggerInterface|null

getState()

get state

public getState() : int
Return values
int

id()

get id

public id() : string
Return values
string

onFrameReceived()

public onFrameReceived(AbstractFrame $frame) : void
Parameters
$frame : AbstractFrame

setConfig()

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

setLogger()

public setLogger(LoggerInterface|null $logger) : void
Parameters
$logger : LoggerInterface|null

setState()

set state

public setState(int $state) : void
Parameters
$state : int

wakeup()

wakeup

public wakeup(string $frameClassOrEvent, AbstractFrame|mixed $return) : void
Parameters
$frameClassOrEvent : string
$return : AbstractFrame|mixed

        
On this page

Search results