Skip to content

Instantly share code, notes, and snippets.

@greevex
Created February 5, 2014 12:06
Show Gist options
  • Save greevex/8822326 to your computer and use it in GitHub Desktop.
Save greevex/8822326 to your computer and use it in GitHub Desktop.
<?php
define('AMQP_NOPARAM', 0);
define('AMQP_DURABLE', 0);
define('AMQP_PASSIVE', 0);
define('AMQP_EXCLUSIVE', 0);
define('AMQP_AUTODELETE', 0);
define('AMQP_INTERNAL', 0);
define('AMQP_NOLOCAL', 0);
define('AMQP_AUTOACK', 0);
define('AMQP_IFEMPTY', 0);
define('AMQP_IFUNUSED', 0);
define('AMQP_MANDATORY', 0);
define('AMQP_IMMEDIATE', 0);
define('AMQP_MULTIPLE', 0);
define('AMQP_NOWAIT', 0);
define('AMQP_EX_TYPE_DIRECT', 0);
define('AMQP_EX_TYPE_FANOUT', 0);
define('AMQP_EX_TYPE_TOPIC', 0);
define('AMQP_EX_TYPE_HEADERS', 0);
class AMQPConnection
{
/**
* Establish a connection with the AMQP broker
*
* @return bool
*/
public function connect() {}
/**
* Create an instance of AMQPConnection
*
* @param array $credentials
*/
public function __construct(array $credentials = []) {}
/**
* Closes the connection with the AMQP broker
*
* @return bool
*/
public function disconnect() { }
/**
* Get the configured host
*
* @return string
*/
public function getHost() { }
/**
* Get the configured login
*
* @return string
*/
public function getLogin() { }
/**
* Get the configured password
*
* @return string
*/
public function getPassword() { }
/**
* Get the configured port
*
* @return int
*/
public function getPort() { }
/**
* Get the configured timeout
*
* @return int
*/
public function getTimeout() { }
/**
* Get the configured vhost
*
* @return string
*/
public function getVhost() { }
/**
* Determine if the AMQPConnection object is connected to the broker
*
* @return bool
*/
public function isConnected() { }
/**
* Closes any open connection and creates a new connection with the AMQP broker
*
* @return bool
*/
public function reconnect() { }
/**
* Set the amqp host
*
* @param string $host
*
* @return bool
*/
public function setHost($host) { }
/**
* Set the login
*
* @param string $login
*
* @return bool
*/
public function setLogin($login) { }
/**
* Set the password
*
* @param string $password
*
* @return bool
*/
public function setPassword($password) { }
/**
* Set the port
*
* @param int $port
*
* @return bool
*/
public function setPort($port) { }
/**
* Set the timeout
*
* @param float $timeout
*
* @return bool
*/
public function setTimeout($timeout) { }
/**
* Set the vhost
*
* @param string $vhost
*
* @return bool
*/
public function setVhost($vhost) { }
}
class AMQPChannel
{
/**
* Commit a pending transaction
*/
public function commitTransaction () { }
/**
* Create an instance of an AMQPChannel object
*
* @param AMQPConnection $amqp_connection
*/
public function __construct (AMQPConnection $amqp_connection) { }
/**
* Check the channel connection
*
* @return bool
*/
public function isConnected () { }
/**
* Set the Quality Of Service settings for the given channel
*
* @param int $size
* @param int $count
*/
public function qos ($size, $count) { }
/**
* Rollback a transaction
*/
public function rollbackTransaction () { }
/**
* Set the number of messages to prefetch from the broker
*
* @param int $count
*/
public function setPrefetchCount ($count) { }
/**
* Set the window size to prefetch from the broker
*
* @param int $size
*/
public function setPrefetchSize ($size) { }
/**
* Start a transaction
*/
public function startTransaction () { }
}
class AMQPExchange
{
/**
* Bind to another exchange
*
* @param $destination_exchange_name
* @param $source_exchange_name
* @param $routing_key
*
* @return bool
*/
public function bind ($destination_exchange_name, $source_exchange_name, $routing_key) { }
/**
* Create an instance of AMQPExchange
*
* @param AMQPChannel $amqp_channel
*/
public function __construct (AMQPChannel $amqp_channel) { }
/**
* Declare a new exchange on the broker
*
* @return int
*/
public function declaree () { }
/**
* Delete the exchange from the broker
*
* @param int $flags
*/
public function delete ($flags = AMQP_NOPARAM) { }
/**
* Get the argument associated with the given key
*
* @param string $key
*
* @return mixed
*/
public function getArgument($key) { }
/**
* Get all arguments set on the given exchange
*
* @return array
*/
public function getArguments() { }
/**
* Get the flag bitmask
*
* @return int
*/
public function getFlags() { }
/**
* Get the configured name
*
* @return string
*/
public function getName() { }
/**
* Get the configured type
*
* @return string
*/
public function getType() { }
/**
* Publish a message to an exchange
*
* @param $message
* @param $routing_key
* @param $flags
* @param array $attributes
*
* @return bool
*/
public function publish ($message, $routing_key, $flags = AMQP_NOPARAM, array $attributes = []) { }
/**
* Set the value for the given key
*
* @param string $key
* @param mixed $value
*/
public function setArgument($key , $value) { }
/**
* Set all arguments on the exchange
*
* @param array $arguments
*/
public function setArguments($arguments) { }
/**
* Set the flags on an exchange
*
* @param int $flags
*/
public function setFlags($flags) { }
/**
* Set the name of the exchange
*
* @param string $name
*/
public function setName($name) { }
/**
* Set the type of the exchange
*
* @param string $type
*/
public function setType($type) { }
}
class AMQPQueue
{
/**
* Acknowledge the receipt of a message
*
* @param int $delivery_tag
* @param int $flags
*
* @return bool
*/
public function ack ($delivery_tag, $flags = AMQP_NOPARAM) { }
/**
* Bind the given queue to a routing key on an exchange
*
* @param string $exchange_name
* @param string $routing_key
*
* @return bool
*/
public function bind ($exchange_name, $routing_key) { }
/**
* Cancel a queue binding
*
* @param string $consumer_tag
*
* @return bool
*/
public function cancel ($consumer_tag = "") { }
/**
* Create an instance of an AMQPQueue object
*
* @param AMQPChannel $amqp_channel
*/
public function __construct (AMQPChannel $amqp_channel) { }
/**
* Consume messages from a queue
*
* @param callable $callback
* @param int $flags
*/
public function consume (callable $callback, $flags = AMQP_NOPARAM) { }
/**
* Declare a new queue
*
* @return int
*/
public function declare_ () { }
/**
* Delete a queue and its contents
*
* @return bool
*/
public function delete () { }
/**
* Retrieve the next message from the queue
*
* @param null $flags
*
* @return mixed
*/
public function get ($flags = null) { }
/**
* Get the argument associated with the given key
*
* @param string $key
*
* @return mixed
*/
public function getArgument ($key) { }
/**
* Get all arguments set on the given queue
*
* @return array
*/
public function getArguments () { }
/**
* Get the flag bitmask
*
* @return int
*/
public function getFlags () { }
/**
* Get the configured name
*
* @return string
*/
public function getName () { }
/**
* Mark a message as explicitly not acknowledged
*
* @param string $delivery_tag
* @param int $flags
*/
public function nack ($delivery_tag, $flags = AMQP_NOPARAM) { }
/**
* Purge the contents of a queue
*
* @return bool
*/
public function purge () { }
/**
* Set the value for the given key
*
* @param string $key
* @param mixed $value
*/
public function setArgument ($key, $value) { }
/**
* Set all arguments on the queue
*
* @param array $arguments
*/
public function setArguments (array $arguments) { }
/**
* Set the queue flags
*
* @param int $flags
*/
public function setFlags ($flags) { }
/**
* Set the queue name
*
* @param string $queue_name
*/
public function setName ($queue_name) { }
/**
* Unbind the queue from a routing key
*
* @param string $exchange_name
* @param string $routing_key
*
* @return bool
*/
public function unbind ($exchange_name, $routing_key) { }
}
class AMQPEnvelope
{
/**
* Get the message appid
*
* @return string
*/
public function getAppId() { }
/**
* Get the message body
*
* @return string
*/
public function getBody() { }
/**
* Get the message contentencoding
*
* @return string
*/
public function getContentEncoding() { }
/**
* Get the message contenttype
*
* @return string
*/
public function getContentType() { }
/**
* Get the message correlation id
*
* @return string
*/
public function getCorrelationId() { }
/**
* Get the message delivery tag
*
* @return string
*/
public function getDeliveryTag() { }
/**
* Get the message exchange
*
* @return string
*/
public function getExchange() { }
/**
* Get the message expiration
*
* @return string
*/
public function getExpiration() { }
/**
* Get a specific message header
*
* @param $header_key
*
* @return string
*/
public function getHeader ($header_key) { }
/**
* Get the message headers
*
* @return array
*/
public function getHeaders() { }
/**
* Get the message id
*
* @return string
*/
public function getMessageId() { }
/**
* Get the message priority
*
* @return string
*/
public function getPriority() { }
/**
* Get the message replyto
*
* @return string
*/
public function getReplyTo() { }
/**
* Get the message routing key
*
* @return string
*/
public function getRoutingKey() { }
/**
* Get the message timestamp
*
* @return string
*/
public function getTimeStamp() { }
/**
* Get the message type
*
* @return string
*/
public function getType() { }
/**
* Get the message user id
*
* @return string
*/
public function getUserId() { }
/**
* Whether this is a redelivery of the message
*
* @return bool
*/
public function isRedelivery() { }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment