承接 herosphp/redis-queue 相关项目开发

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

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

herosphp/redis-queue

最新稳定版本:v1.0.0

Composer 安装命令:

composer require herosphp/redis-queue

包简介

Redis-Queue adapter herosphp Framework

README 文档

README

redis-queue

install

    composer install herosphp/redis-queue

usage

publish queue.config.php

    composer vendor:publish "herosphp/redis-queue"

config/process.config.php

return [
    'redis-queue' => [
        'enable' => true,
        'handler' => Consumer::class,
        'count' => 1,
        'constructor' => [
            'consumer_dir' => APP_PATH.'queue',
        ],
    ],
];

app/queue/DemoQueue.php

<?php
declare(strict_types=1);

namespace app\queue;

use herosphp\plugin\queue\ConsumerInterface;

class DemoQueue implements ConsumerInterface
{
    //要消费的队列名
    public string $queue = 'demo';

    // 连接名,对应 config/redis_queue.php 里的连接`
    public string $connection = 'default';

    public function consume(array $data): void
    {
        echo 'queue'.json_encode($data).PHP_EOL;
    }
}

client

Client::send('demo', [1,2,3]); or Client::send('demo', [1,2,3],5); // delay 5s

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-09-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固