PHP 클래스 AMQPConnection

파일 보기 프로젝트 열기: pdezwart/php-amqp 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( array $credentials = [] ) Create an instance of AMQPConnection.
connect ( ) : boolean Establish a transient connection with the AMQP broker.
disconnect ( ) : boolean Closes the transient connection with the AMQP broker.
getCACert ( ) : string Get path to the CA cert file in PEM format
getCert ( ) : string Get path to the client certificate in PEM format
getHeartbeatInterval ( ) : integer Get number of seconds between heartbeats of the connection in seconds.
getHost ( ) : string Get the configured host.
getKey ( ) : string Get path to the client key in PEM format
getLogin ( ) : string Get the configured login.
getMaxChannels ( ) : integer Get the maximum number of channels the connection can handle.
getMaxFrameSize ( ) : integer Get max supported frame size per connection in bytes.
getPassword ( ) : string Get the configured password.
getPort ( ) : integer Get the configured port.
getReadTimeout ( ) : float Get the configured interval of time to wait for income activity from AMQP broker
getTimeout ( ) : float Get the configured interval of time to wait for income activity from AMQP broker
getUsedChannels ( ) : integer Return last used channel id during current connection session.
getVerify ( ) : boolean Get whether peer verification enabled or disabled
getVhost ( ) : string Get the configured vhost.
getWriteTimeout ( ) : float Get the configured interval of time to wait for outcome activity to AMQP broker
isConnected ( ) : boolean Check whether the connection to the AMQP broker is still valid.
isPersistent ( ) : boolean Whether connection persistent.
pconnect ( ) : boolean Establish a persistent connection with the AMQP broker.
pdisconnect ( ) : boolean Closes a persistent connection with the AMQP broker.
preconnect ( ) : boolean Close any open persistent connections and initiate a new one with the AMQP broker.
reconnect ( ) : boolean Close any open transient connections and initiate a new one with the AMQP broker.
setCACert ( string $cacert ) Set path to the CA cert file in PEM format
setCert ( string $cert ) Set path to the client certificate in PEM format
setHost ( string $host ) : boolean Set the hostname used to connect to the AMQP broker.
setKey ( string $key ) Set path to the client key in PEM format
setLogin ( string $login ) : boolean Set the login string used to connect to the AMQP broker.
setPassword ( string $password ) : boolean Set the password string used to connect to the AMQP broker.
setPort ( integer $port ) : boolean Set the port used to connect to the AMQP broker.
setReadTimeout ( integer $timeout ) : boolean Sets the interval of time to wait for income activity from AMQP broker
setTimeout ( integer $timeout ) : boolean Sets the interval of time to wait for income activity from AMQP broker
setVerify ( boolean $verify ) Enable or disable peer verification
setVhost ( string $vhost ) : boolean Sets the virtual host to which to connect on the AMQP broker.
setWriteTimeout ( integer $timeout ) : boolean Sets the interval of time to wait for outcome activity to AMQP broker

메소드 상세

__construct() 공개 메소드

Creates an AMQPConnection instance representing a connection to an AMQP broker. A connection will not be established until AMQPConnection::connect() is called. $credentials = array( 'host' => amqp.host The host to connect too. Note: Max 1024 characters. 'port' => amqp.port Port on the host. 'vhost' => amqp.vhost The virtual host on the host. Note: Max 128 characters. 'login' => amqp.login The login name to use. Note: Max 128 characters. 'password' => amqp.password Password. Note: Max 128 characters. 'read_timeout' => Timeout in for income activity. Note: 0 or greater seconds. May be fractional. 'write_timeout' => Timeout in for outcome activity. Note: 0 or greater seconds. May be fractional. 'connect_timeout' => Connection timeout. Note: 0 or greater seconds. May be fractional. Connection tuning options (see http://www.rabbitmq.com/amqp-0-9-1-reference.html#connection.tune for details): 'channel_max' => Specifies highest channel number that the server permits. 0 means standard extension limit (see PHP_AMQP_MAX_CHANNELS constant) 'frame_max' => The largest frame size that the server proposes for the connection, including frame header and end-byte. 0 means standard extension limit (depends on librabbimq default frame size limit) 'heartbeat' => The delay, in seconds, of the connection heartbeat that the server wants. 0 means the server does not want a heartbeat. Note, librabbitmq has limited heartbeat support, which means heartbeats checked only during blocking calls. TLS support (see https://www.rabbitmq.com/ssl.html for details): 'cacert' => Path to the CA cert file in PEM format.. 'cert' => Path to the client certificate in PEM foramt. 'key' => Path to the client key in PEM format. 'verify' => Enable or disable peer verification. If peer verification is enabled then the common name in the server certificate must match the server name. Peer verification is enabled by default. )
public __construct ( array $credentials = [] )
$credentials array Optional array of credential information for connecting to the AMQP broker.

connect() 공개 메소드

This method will initiate a connection with the AMQP broker.
public connect ( ) : boolean
리턴 boolean TRUE on success or throw an exception on failure.

disconnect() 공개 메소드

This method will close an open connection with the AMQP broker.
public disconnect ( ) : boolean
리턴 boolean true if connection was successfully closed, false otherwise.

getCACert() 공개 메소드

Get path to the CA cert file in PEM format
public getCACert ( ) : string
리턴 string

getCert() 공개 메소드

Get path to the client certificate in PEM format
public getCert ( ) : string
리턴 string

getHeartbeatInterval() 공개 메소드

When connection is connected, effective connection value returned, which is normally the same as original correspondent value passed to constructor, otherwise original value passed to constructor returned.
public getHeartbeatInterval ( ) : integer
리턴 integer

getHost() 공개 메소드

Get the configured host.
public getHost ( ) : string
리턴 string The configured hostname of the broker

getKey() 공개 메소드

Get path to the client key in PEM format
public getKey ( ) : string
리턴 string

getLogin() 공개 메소드

Get the configured login.
public getLogin ( ) : string
리턴 string The configured login as a string.

getMaxChannels() 공개 메소드

When connection is connected, effective connection value returned, which is normally the same as original correspondent value passed to constructor, otherwise original value passed to constructor returned.
public getMaxChannels ( ) : integer
리턴 integer

getMaxFrameSize() 공개 메소드

When connection is connected, effective connection value returned, which is normally the same as original correspondent value passed to constructor, otherwise original value passed to constructor returned.
public getMaxFrameSize ( ) : integer
리턴 integer

getPassword() 공개 메소드

Get the configured password.
public getPassword ( ) : string
리턴 string The configured password as a string.

getPort() 공개 메소드

Get the configured port.
public getPort ( ) : integer
리턴 integer The configured port as an integer.

getReadTimeout() 공개 메소드

Get the configured interval of time to wait for income activity from AMQP broker
public getReadTimeout ( ) : float
리턴 float

getTimeout() 공개 메소드

Get the configured interval of time to wait for income activity from AMQP broker
사용 중단: use AMQPConnection::getReadTimout() instead
public getTimeout ( ) : float
리턴 float

getUsedChannels() 공개 메소드

Return last used channel id during current connection session.
public getUsedChannels ( ) : integer
리턴 integer

getVerify() 공개 메소드

Get whether peer verification enabled or disabled
public getVerify ( ) : boolean
리턴 boolean

getVhost() 공개 메소드

Get the configured vhost.
public getVhost ( ) : string
리턴 string The configured virtual host as a string.

getWriteTimeout() 공개 메소드

Get the configured interval of time to wait for outcome activity to AMQP broker
public getWriteTimeout ( ) : float
리턴 float

isConnected() 공개 메소드

It does so by checking the return status of the last connect-command.
public isConnected ( ) : boolean
리턴 boolean True if connected, false otherwise.

isPersistent() 공개 메소드

When connection is not connected, boolean false always returned
public isPersistent ( ) : boolean
리턴 boolean

pconnect() 공개 메소드

This method will initiate a connection with the AMQP broker or reuse an existing one if present.
public pconnect ( ) : boolean
리턴 boolean TRUE on success or throws an exception on failure.

pdisconnect() 공개 메소드

This method will close an open persistent connection with the AMQP broker.
public pdisconnect ( ) : boolean
리턴 boolean true if connection was found and closed, false if no persistent connection with this host, port, vhost and login could be found,

preconnect() 공개 메소드

Close any open persistent connections and initiate a new one with the AMQP broker.
public preconnect ( ) : boolean
리턴 boolean TRUE on success or FALSE on failure.

reconnect() 공개 메소드

Close any open transient connections and initiate a new one with the AMQP broker.
public reconnect ( ) : boolean
리턴 boolean TRUE on success or FALSE on failure.

setCACert() 공개 메소드

Set path to the CA cert file in PEM format
public setCACert ( string $cacert )
$cacert string

setCert() 공개 메소드

Set path to the client certificate in PEM format
public setCert ( string $cert )
$cert string

setHost() 공개 메소드

Set the hostname used to connect to the AMQP broker.
public setHost ( string $host ) : boolean
$host string The hostname of the AMQP broker.
리턴 boolean TRUE on success or FALSE on failure.

setKey() 공개 메소드

Set path to the client key in PEM format
public setKey ( string $key )
$key string

setLogin() 공개 메소드

Set the login string used to connect to the AMQP broker.
public setLogin ( string $login ) : boolean
$login string The login string used to authenticate with the AMQP broker.
리턴 boolean TRUE on success or FALSE on failure.

setPassword() 공개 메소드

Set the password string used to connect to the AMQP broker.
public setPassword ( string $password ) : boolean
$password string The password string used to authenticate with the AMQP broker.
리턴 boolean TRUE on success or FALSE on failure.

setPort() 공개 메소드

Set the port used to connect to the AMQP broker.
public setPort ( integer $port ) : boolean
$port integer The port used to connect to the AMQP broker.
리턴 boolean TRUE on success or FALSE on failure.

setReadTimeout() 공개 메소드

Sets the interval of time to wait for income activity from AMQP broker
public setReadTimeout ( integer $timeout ) : boolean
$timeout integer
리턴 boolean

setTimeout() 공개 메소드

Sets the interval of time to wait for income activity from AMQP broker
사용 중단: use AMQPConnection::setReadTimout($timeout) instead
public setTimeout ( integer $timeout ) : boolean
$timeout integer
리턴 boolean

setVerify() 공개 메소드

Enable or disable peer verification
public setVerify ( boolean $verify )
$verify boolean

setVhost() 공개 메소드

Sets the virtual host to which to connect on the AMQP broker.
public setVhost ( string $vhost ) : boolean
$vhost string The virtual host to use on the AMQP broker.
리턴 boolean true on success or false on failure.

setWriteTimeout() 공개 메소드

Sets the interval of time to wait for outcome activity to AMQP broker
public setWriteTimeout ( integer $timeout ) : boolean
$timeout integer
리턴 boolean