mineadmin / next-core-x

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

中文 | English

NextCoreX

基于 hyperf 实现的基础 channel 包、提供最基本的 pull push subscribe publish 功能 内置实现了 orm redi rabbitmq 驱动

安装

composer require mine/next-core-x

使用

通过定时器进行 pull push 处理

// app/Process/ImProcess.php
use Mine\NextCoreX\Queue;
use Hyperf\WebSocketServer\Sender;
class ImProcess extends AbstractProcess
{
    public function __construct(
      private readonly Queue $queue,
      private readonly Sender $sender
    ) {}
    public function handle()
    {
        $data = Queue::pull('user_messages');
        foreach ($data as $item) {
            
        }
    }
}

About


Languages

Language:PHP 100.0%