PHP 클래스 AMQPExchange

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

공개 메소드들

메소드 설명
__construct ( AMQPChannel $amqp_channel ) Create an instance of AMQPExchange.
bind ( string $exchange_name, string $routing_key = '', array $arguments = [] ) : boolean Bind to another exchange.
declareExchange ( ) : boolean Declare a new exchange on the broker.
delete ( string $exchangeName = null, integer $flags = AMQP_NOPARAM ) : boolean Delete the exchange from the broker.
getArgument ( string $key ) : string | integer | boolean Get the argument associated with the given key.
getArguments ( ) : array Get all arguments set on the given exchange.
getChannel ( ) : AMQPChannel Get the AMQPChannel object in use
getConnection ( ) : AMQPConnection Get the AMQPConnection object in use
getFlags ( ) : integer Get all the flags currently set on the given exchange.
getName ( ) : string Get the configured name.
getType ( ) : string Get the configured type.
hasArgument ( string $key ) : boolean Check whether argument associated with the given key exists.
publish ( string $message, string $routing_key = null, integer $flags = AMQP_NOPARAM, array $attributes = [] ) : boolean Publish a message to an exchange.
setArgument ( string $key, string | integer $value ) : boolean Set the value for the given key.
setArguments ( array $arguments ) : boolean Set all arguments on the exchange.
setFlags ( integer $flags ) : void Set the flags on an exchange.
setName ( string $exchange_name ) : void Set the name of the exchange.
setType ( string $exchange_type ) : void Set the type of the exchange.
unbind ( string $exchange_name, string $routing_key = '', array $arguments = [] ) : boolean Remove binding to another exchange.

메소드 상세

__construct() 공개 메소드

Returns a new instance of an AMQPExchange object, associated with the given AMQPChannel object.
public __construct ( AMQPChannel $amqp_channel )
$amqp_channel AMQPChannel A valid AMQPChannel object, connected to a broker.

bind() 공개 메소드

Bind an exchange to another exchange using the specified routing key.
public bind ( string $exchange_name, string $routing_key = '', array $arguments = [] ) : boolean
$exchange_name string Name of the exchange to bind.
$routing_key string The routing key to use for binding.
$arguments array Additional binding arguments.
리턴 boolean true on success or false on failure.

declareExchange() 공개 메소드

Declare a new exchange on the broker.
public declareExchange ( ) : boolean
리턴 boolean TRUE on success or FALSE on failure.

delete() 공개 메소드

Delete the exchange from the broker.
public delete ( string $exchangeName = null, integer $flags = AMQP_NOPARAM ) : boolean
$exchangeName string Optional name of exchange to delete.
$flags integer Optionally AMQP_IFUNUSED can be specified to indicate the exchange should not be deleted until no clients are connected to it.
리턴 boolean true on success or false on failure.

getArgument() 공개 메소드

Get the argument associated with the given key.
public getArgument ( string $key ) : string | integer | boolean
$key string The key to look up.
리턴 string | integer | boolean The string or integer value associated with the given key, or FALSE if the key is not set.

getArguments() 공개 메소드

Get all arguments set on the given exchange.
public getArguments ( ) : array
리턴 array An array containing all of the set key/value pairs.

getChannel() 공개 메소드

Get the AMQPChannel object in use
public getChannel ( ) : AMQPChannel
리턴 AMQPChannel

getConnection() 공개 메소드

Get the AMQPConnection object in use
public getConnection ( ) : AMQPConnection
리턴 AMQPConnection

getFlags() 공개 메소드

Get all the flags currently set on the given exchange.
public getFlags ( ) : integer
리턴 integer An integer bitmask of all the flags currently set on this exchange object.

getName() 공개 메소드

Get the configured name.
public getName ( ) : string
리턴 string The configured name as a string.

getType() 공개 메소드

Get the configured type.
public getType ( ) : string
리턴 string The configured type as a string.

hasArgument() 공개 메소드

Check whether argument associated with the given key exists.
public hasArgument ( string $key ) : boolean
$key string The key to look up.
리턴 boolean

publish() 공개 메소드

Publish a message to the exchange represented by the AMQPExchange object.
public publish ( string $message, string $routing_key = null, integer $flags = AMQP_NOPARAM, array $attributes = [] ) : boolean
$message string The message to publish.
$routing_key string The optional routing key to which to publish to.
$flags integer One or more of AMQP_MANDATORY and AMQP_IMMEDIATE.
$attributes array One of content_type, content_encoding, message_id, user_id, app_id, delivery_mode, priority, timestamp, expiration, type or reply_to, headers.
리턴 boolean TRUE on success or FALSE on failure.

setArgument() 공개 메소드

Set the value for the given key.
public setArgument ( string $key, string | integer $value ) : boolean
$key string Name of the argument to set.
$value string | integer Value of the argument to set.
리턴 boolean TRUE on success or FALSE on failure.

setArguments() 공개 메소드

Set all arguments on the exchange.
public setArguments ( array $arguments ) : boolean
$arguments array An array of key/value pairs of arguments.
리턴 boolean TRUE on success or FALSE on failure.

setFlags() 공개 메소드

Set the flags on an exchange.
public setFlags ( integer $flags ) : void
$flags integer A bitmask of flags. This call currently only considers the following flags: AMQP_DURABLE, AMQP_PASSIVE (and AMQP_DURABLE, if librabbitmq version >= 0.5.3)
리턴 void

setName() 공개 메소드

Set the name of the exchange.
public setName ( string $exchange_name ) : void
$exchange_name string The name of the exchange to set as string.
리턴 void

setType() 공개 메소드

Set the type of the exchange. This can be any of AMQP_EX_TYPE_DIRECT, AMQP_EX_TYPE_FANOUT, AMQP_EX_TYPE_HEADERS or AMQP_EX_TYPE_TOPIC.
public setType ( string $exchange_type ) : void
$exchange_type string The type of exchange as a string.
리턴 void

unbind() 공개 메소드

Remove a routing key binding on an another exchange from the given exchange.
public unbind ( string $exchange_name, string $routing_key = '', array $arguments = [] ) : boolean
$exchange_name string Name of the exchange to bind.
$routing_key string The routing key to use for binding.
$arguments array Additional binding arguments.
리턴 boolean true on success or false on failure.