PHP Classes

File: example/mq.php

Recommend this page to a friend!
  Classes of Jorge Castro   UsagiMQ   example/mq.php   Download  
File: example/mq.php
Role: Example script
Content type: text/plain
Description: Example script
Class: UsagiMQ
Manage message queues stored using Redis
Author: By
Last change:
Date: 4 years ago
Size: 426 bytes
 

Contents

Class file image Download
<?php
include "../UsagiMQ.php";

$usa=new UsagiMQ("127.0.0.1",6379,1);
if (
$usa->connected) {
   
$info=$usa->receive();
    if (
$info=='NO INFO') {
       
$refresh=$usa->webUI(); // if not information is send, then it opens the UI. It is optional
       
if ($refresh) {
           
//todo: call the subscriber(s)
       
}
    } else {
        echo
$info; // show the result.
   
}
} else {
    echo
"not connected";
}