artox-lab/rabbitmq-wrapper

1.0.2 2016-03-15 07:57 UTC

README

Installation via Composer

{
    "require": {
        "artox-lab/rabbitmq-wrapper": "1.0.0"
    }
}

Run composer update

Config Usage

<?php

include 'vendor/autoload.php';

// Initial class
$rabbitMQ = $rabbitMQ = new \RabbitMQWrapper\RabbitMQ();

// Creating new queue
$rabbitMQ->createQueue($queueTitle);

// Publishing message to queue
$rabbitMQ->publishMessage($message, $queueTitle);

// Getting last message from queue
$rabbitMQ->getMessage($queueTitle);

// Listening messages from queue (daemon mode)
$rabbitMQ->startListening($queueTitle, $callback);