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
Package info
github.com/farmani/laravel-openswoole-redis-pool
pkg:composer/farmani/laravel-openswoole-redis-pool
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
Suggests
None
Provides
None
Conflicts
None
Replaces
None
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.phpfilestoressection belowredisarray
'redis_pool' => [ 'driver' => 'redis', 'connection' => 'default', ],
- step 3: change your redis drive or session drive to
redis_poolin your.envfile , that is it