antyblin/laravel-swoole-redis

Laravel package to provide swoole redis pool integration, Laravel redis pool cache and session driver.
1,228 1
Install
composer require antyblin/laravel-swoole-redis
Latest Version:1.1
PHP:>=7.4
Laravel:5 – 10
License:MIT
Last Updated:May 3, 2023
Links: GitHub  ·  Packagist
Maintainer: antyblin

Swoole Redis Pool cache and session driver for Laravel

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 falcolee/laravel-swoole-redis package, original idea belongs to https://github.com/falcolee.

Installation

Step 1:

Install package

composer require antyblin/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)
    ],

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

644,549,754 9,698
laravel/framework

The Laravel Framework.

598,760,099 34,966
laravel/tinker

Powerful REPL for the Laravel framework.

507,193,856 7,441
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

423,477,751 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

403,217,078 4,664

Version History

Version Released PHP Laravel License
1.1 >=7.4 ^5.0|^6.0|^7.0|^8.0|^9.0|^10.0 MIT
1.0.1 >=7.4 ^5.0|^6.0|^7.0|^8.0 MIT
1.0.0 >=7.4 ^5.0|^6.0|^7.0|^8.0 MIT
0.0.1 >=5.6.4 ^5.0|^6.0|^7.0|^8.0 MIT