amphp / redis
A non-blocking Redis client for Amp.
Fund package maintenance!
amphp
Installs: 133 051
Dependents: 22
Suggesters: 4
Security: 0
Stars: 129
Watchers: 10
Forks: 26
Open Issues: 4
Requires
- php: >=8.1
- amphp/amp: ^3
- amphp/byte-stream: ^2
- amphp/cache: ^2
- amphp/pipeline: ^1
- amphp/serialization: ^1
- amphp/socket: ^2
- amphp/sync: ^2
- league/uri: ^6.5
- league/uri-parser: ^1.4
- psr/log: ^3.0
- revolt/event-loop: ^0.2.4
Requires (Dev)
- amphp/php-cs-fixer-config: ^2-dev
- amphp/phpunit-util: ^3
- amphp/process: ^2
- phpunit/phpunit: ^9
- psalm/phar: ^4.22
This package is auto-updated.
Last update: 2022-07-11 22:38:26 UTC
README
amphp/redis
provides non-blocking access to Redis instances.
All I/O operations are handled by the Amp concurrency framework, so you should be familiar with the basics of it.
Installation
This package can be installed as a Composer dependency.
composer require amphp/redis
Usage
<?php require __DIR__ . '/vendor/autoload.php'; use Amp\Redis\Config; use Amp\Redis\Redis; use Amp\Redis\RemoteExecutor; Amp\Loop::run(static function () { $redis = new Redis(new RemoteExecutor(Config::fromUri('redis://'))); yield $redis->set('foo', '21'); $result = yield $redis->increment('foo', 21); \var_dump($result); // int(42) });
Security
If you discover any security related issues, please email me@kelunik.com
instead of using the issue tracker.
License
The MIT License (MIT). Please see LICENSE
for more information.