Skip to content

A simplified Rabbit MQ library written on top of the PHP AMQP Library

License

Notifications You must be signed in to change notification settings

mam-luk/tavshan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tavshan by Mamluk

Tavshan is a simplified Rabbit MQ library written on top of the PHP AMQP Library. It doesn't utilise all the bells and whistles within Rabbit MQ yet, but will be enhanced as required (or with your contributions).

What does Tavshan mean?

It's actually tavşan (pronounced as tavshan), and means rabbit in Turkish.

How to use it?

Include it by adding mamluk/tavhan to your composer.json file.

use Mamluk\Tavhan\Queue
use Monolog\Logger;
use Psr\Log\LogLevel;

$logger = new Monolog\Logger('myQueue');
$logger->pushHandler(new StreamHandler('php://stdout', LogLevel::DEBUG));

$q = new Queue($config, $logger, 'queue_name', 1); // See __construct() src/Queue for what the config array requires

// Produce a message
$q->publish('My first message');

// Consume messages
$callback = function ($msg) {
  echo ' [x] Received ', $msg->body, "\n";
};
$this->q->subscribe($callback, 'queue_name');

License

MIT

About

A simplified Rabbit MQ library written on top of the PHP AMQP Library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages