PHP code example of scienta / php-rsmq-client

1. Go to this page and download the library: Download scienta/php-rsmq-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

scienta / php-rsmq-client example snippets


use Scienta\RSMQClient\Config;
use Scienta\RSMQClient\Message;
use Scienta\RSMQClient\Queue;
use Scienta\RSMQClient\Redis\RedisAdapter;

//Create a redis connection
$redis = new \Redis();
$redis->connect('127.0.0.1', '6379');

//Configure and create/sync a queue
$config = new Config('myqueue');
$redisAdapter = new RedisAdapter($redis);
$queue = new Queue($config, $redisAdapter);

//Create a message
$message = new Message('Hello World');

//Send the message
$sentId = $queue->sendMessage($message);
json
{
	"nta/php-rsmq-client": "~1.0"
	}
}