farmani / laravel-openswoole-redis-pool
Laravel package to provide openswoole redis pool integration, laravel redis pool cache and session driver. Aims to avoid redis server timeout exception
v1.0.0
2022-12-23 08:38 UTC
Requires
- php: >=8.1
- ext-openswoole: >=22.0
- illuminate/cache: ^9.0
- illuminate/redis: ^9.0
- illuminate/session: ^9.0
- illuminate/support: ^9.0
- openswoole/core: ^22.0
Requires (Dev)
- openswoole/ide-helper: ~22.0.0
README
Laravel package to provide openswoole redis pool integration, laravel redis pool cache and session driver.
change your default redis database configuration as follows:
'default' => [ 'url' => env('REDIS_URL'), 'host' => env('REDIS_HOST', 'redis.waptap.dev'), 'password' => env('REDIS_PASSWORD', null), 'port' => env('REDIS_PORT', '6379'), 'database' => env('REDIS_DB', '0'), 'read_timeout' => 3.0, 'timeout' => 15.0, 'retry_interval' => 0, 'reserved' => '', 'pool' => [ 'min' => 128, 'max' => 128, 'idle_time' => -1, 'idle_interval' => 1000, 'heartbeat' => 3000, 'retry_interval' => 10, 'retry_times' => 3, ], ],
install
composer require farmani/laravel-openswoole-redis-pool
how to use
- step 1: make true you've got a right swoole environment
- step 2: add this new storage in your
config/cache.php
filestores
section belowredis
array
'redis_pool' => [ 'driver' => 'redis', 'connection' => 'default', ],
- step 3: change your redis drive or session drive to
redis_pool
in your.env
file , that is it