shashandr / laravel-swoole-redis
Laravel package to provide swoole redis pool integration, Laravel redis pool cache and session driver.
Installs: 23
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 0
Forks: 7
pkg:composer/shashandr/laravel-swoole-redis
Requires
- php: >=8.1
- illuminate/support: ^10.0|^11.0
Requires (Dev)
- laravel/framework: ^11.0
- swoole/ide-helper: @dev
This package is not auto-updated.
Last update: 2025-12-24 09:51:16 UTC
README
Default Laravel redis connection may cause errors when running in Swoole coroutines.
This package adds support of Swoole RedisPool as a cache and session driver for Laravel.
This is a fork of antyblin/laravel-swoole-redis package, original idea belongs to https://github.com/antyblin.
Installation
Step 1:
Install package
composer require shashandr/laravel-swoole-redis
Step 2:
Add redis_pool store to the stores section in config/cache.php:
'redis_pool' => [ 'driver' => 'redis', 'connection' => 'default', ],
Step 3:
Change your redis driver or session driver to redis_pool in your .env file and that is it.
Config
You may add additional parameter 'pool_size' to the redis section in config/database.php.
This parameter sets maximum quantity of connections in RedisPool.
'default' => [ 'url' => env('REDIS_URL'), 'host' => env('REDIS_HOST'), 'password' => env('REDIS_PASSWORD'), 'port' => env('REDIS_PORT'), 'database' => env('REDIS_CACHE_DB'), 'pool_size' => env('REDIS_POOL_SIZE', 64) ],