mmfei/hyperf-async-event

An async event for hyperf.

v3.0.2 2023-01-11 15:16 UTC

This package is auto-updated.

Last update: 2024-03-11 18:08:56 UTC


README

这是基于 async-queue 的 event 的异步框架

event async-queue

Installation

composer require mmfei/event
composer require mmfei/async-queue
composer require mmfei/hyperf-async-event

Configuration

Publish config

php bin/hyperf.php vendor:publish mmfei/hyperf-async-event

Config files:

+ ./config/autoload/async_queue.php
+ ./config/autoload/dependencies.php
+ ./config/autoload/processer.php
+ ./config/autoload/redis.php

Usage

$event = new \StdClass();
//$event->async_delay = 0;
$event->is_support_async = true;
$event->data = 'test';
\Hyperf\Utils\ApplicationContext::getContainer()->get(EventDispatcherInterface::class)->dispatch($event);

More configure

Only some events are asynchronous?