承接 juanber84/phpqueue 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

juanber84/phpqueue

Composer 安装命令:

composer require juanber84/phpqueue

包简介

Queue system in php

关键字:

README 文档

README

Queue system in php

Install

Install via Composer

{
    "require": {
        "juanber84/phpqueue": "dev-master"
    }
}

Autoloading

Composer generates a vendor/autoload.php file. You can simply include this file and you will get autoloading for free.

require 'vendor/autoload.php';

Example of Publisher

<?php
require 'vendor/autoload.php';

use phpqueue\Publisher;

$data = array(
	'name' 		=> 'juan',
	'surname' 	=> 'berzal',
	'email' 	=> 'juanber84@gmail.com'
);

$messages =json_encode($data);

$publisher = new Publisher();
$publisher->setQueue('123456');         
$publisher->setMessage($messages);
$publisher->setBlock_send(true);   // synchronous send
//$publisher->setBlock_send(false);  // asynchronous send
$response = $publisher->publish(); // empty response or array of fails

Example of Consumer

<?php
require 'vendor/autoload.php';

use phpqueue\Consumer;

$consumer = new Consumer();
$consumer->setQueue('123456'); 
do {
	echo $consumer->pickup(); 
	// try it out
} while (true);   	

Example of Use

  • Copy the example of publisher code in publisher.php
  • Copy the example of consumer code in consumer.php

Start the consumer

$ php consumer.php

Throw the publiser

$ php publisher.php

统计信息

  • 总下载量: 53
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 11
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 11
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-10-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固