friendsofhyperf / websocket-cluster-addon
Websocket cluster addon base redis subscribe.
Fund package maintenance!
huangdijia
hdj.me/sponsors
Requires
- friendsofhyperf/ipc-broadcaster: ~3.1.2
- hyperf/coordinator: ~3.1.0
- hyperf/di: ~3.1.0
- hyperf/event: ~3.1.0
- hyperf/framework: ~3.1.0
- hyperf/http-server: ~3.1.0
- hyperf/process: ~3.1.0
- hyperf/redis: ~3.1.0
- hyperf/signal: ~3.1.0
- hyperf/websocket-server: ~3.1.0
Requires (Dev)
- friendsofhyperf/redis-subscriber: ~3.1.0
- friendsofphp/php-cs-fixer: ^3.0
- hyperf/testing: ~3.1.0
- mix/redis-subscriber: ^3.0
- mockery/mockery: ^1.0
- phpstan/phpstan: ^1.0
- phpunit/phpunit: ^10.0
- swoole/ide-helper: dev-master
Suggests
- friendsofhyperf/redis-subscriber: Redis subscriber for websocket cluster.(^3.1.0)
- mix/redis-subscriber: Redis subscriber for websocket cluster.(^3.0)
- dev-main / 5.x-dev
- v5.0.4.1
- v5.0.4
- v5.0.3
- v5.0.2
- v5.0.1
- v5.0.0
- v5.0.0-beta.2
- v5.0.0-beta.1
- 4.x-dev
- v4.0.0-rc.1
- v4.0.0-beta.8
- v4.0.0-beta.7
- v4.0.0-beta.6
- v4.0.0-beta.5
- v4.0.0-beta.4
- v4.0.0-beta.3
- v4.0.0-beta.2
- v4.0.0-beta.1
- 3.x-dev
- v3.1.1
- v3.1.0
- v3.1.0-beta.4
- v3.1.0-beta.3
- v3.1.0-beta.2
- v3.1.0-beta.1
- 3.0.8
- 3.0.6
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 2.x-dev
- v2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.1.4
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.21
- 1.0.20
- 1.0.19
- 1.0.18
- 1.0.17
- 1.0.16
- 1.0.15
- 1.0.14
- 1.0.13
- 1.0.12
- 1.0.11
- 1.0.10
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- dev-optimize-routes
This package is auto-updated.
Last update: 2024-12-04 01:31:19 UTC
README
Websocket cluster addon base redis subscribe.
Installation
-
Requirements
- PHP >= 8.1
- Swoole >= 5.0.0
- hyperf/websocket-server >= 3.1.0
-
Composer install
composer require friendsofhyperf/websocket-cluster-addon:^5.0
- Publish
php bin/hyperf.php vendor:publish friendsofhyperf/websocket-cluster-addon
Usage
- Send message
use FriendsOfHyperf\WebsocketClusterAddon\Emitter; $emitter = $container->get(Emitter::class); $emitter->emit($contactId, $message);
- Broadcast message
use FriendsOfHyperf\WebsocketClusterAddon\Emitter; $emitter = $container->get(Emitter::class); $emitter->broadcast($message);
Examples
Drivers
-
Node
- Memory
default
- Redis
- Swoole Table
- Memory
-
Client
- Redis
default
- Swoole Table
- Redis