PHP Classes

File: sample/publisher-sample-with-redis-config.php

Recommend this page to a friend!
  Classes of Leonardo Di Sarli   Taurus Publisher PHP Redis Client Library   sample/publisher-sample-with-redis-config.php   Download  
File: sample/publisher-sample-with-redis-config.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Taurus Publisher PHP Redis Client Library
Send jobs to a Redis server using LUA scripts
Author: By
Last change:
Date: 1 year ago
Size: 412 bytes
 

Contents

Class file image Download
<?php

require_once __DIR__ . '/../vendor/autoload.php';

use
TaurusPublisher\TaurusPublisher;

$queue = 'test';
$data = [
   
'publisher' => 'example',
];

$redisConfig = [
   
'scheme' => 'tcp',
   
'host' => 'localhost',
   
'port' => 6379,
];

$taurus = new TaurusPublisher($redisConfig);

print_r('Publish');
echo
PHP_EOL;

$result = $taurus->add(
   
$queue,
   
$data
);

print_r($result);
echo
PHP_EOL;