承接 riorizkyrainey/pubsub-redis-php 相关项目开发

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

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

riorizkyrainey/pubsub-redis-php

Composer 安装命令:

composer require riorizkyrainey/pubsub-redis-php

包简介

Pub/Sub Redis for php

README 文档

README

Pub/Sub Redis for php

PHP Composer

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

Before you go make sure you already install Redis.

Installing

Install with composer

composer require riorizkyrainey/pubsub-redis-php

Usage - Subscribe

$client = new Predis\Client([
    'scheme' => 'tcp',
    'host' => 'redis',
    'port' => 6379,
    'database' => 0,
    'read_write_timeout' => 0,
]);

$redisSubscribeAdapter = new \RioRizkyRainey\PubsubRedis\RedisSubscribeAdapter();
$redisSubscribeAdapter->setClient($client)
    ->setChannel('channel')
    ->subscribe(function ($message) {
        printf($message . PHP_EOL);
    });

Usage - Publisher

$client = new Predis\Client([
    'scheme' => 'tcp',
    'host' => 'redis',
    'port' => 6379,
    'database' => 0,
    'read_write_timeout' => 0,
]);

$redisPublishAdapter = new \RioRizkyRainey\PubsubRedis\RedisPublishAdapter();
$redisPublishAdapter->setClient($client)
    ->setChannel('channel');

$redisPublishAdapter->publishMessage('Hi, How do you do?');
$redisPublishAdapter->publishBulkMessage(['Nice to meet you', 'Where are you going?']);
$redisPublishAdapter->publishMessage('I don\'t feel good mr stark');

Built With

  • Predis - Flexible and feature-complete Redis client for PHP and HHVM
  • PHPUnit - The PHP Unit Testing framework.
  • Mockery - Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-06-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固