PHPackages                             laravie/predis-async - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. laravie/predis-async

ActiveLibrary[Caching](/categories/caching)

laravie/predis-async
====================

Asynchronous version of Predis

v0.4.1(4y ago)633.3k↓35.2%1MITPHPPHP ^7.2 || ^8.0

Since Sep 13Pushed 4y ago1 watchersCompare

[ Source](https://github.com/laravie/predis-async)[ Packagist](https://packagist.org/packages/laravie/predis-async)[ Docs](http://github.com/laravie/predis-async)[ Fund](https://paypal.me/crynobone)[ Fund](https://liberapay.com/crynobone)[ RSS](/packages/laravie-predis-async/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (4)Versions (7)Used By (1)

Predis\\Async
=============

[](#predisasync)

[![tests](https://github.com/laravie/predis-async/workflows/tests/badge.svg?branch=master)](https://github.com/laravie/predis-async/actions?query=workflow%3Atests+branch%3Amaster)[![Latest Stable Version](https://camo.githubusercontent.com/765340bf907ad32a1d0bc1676edaf9ebbb0b6f7fb2d8562eadcab4a2b3b807e7/68747470733a2f2f706f7365722e707567782e6f72672f6c6172617669652f7072656469732d6173796e632f762f737461626c65)](https://packagist.org/packages/laravie/predis-async)[![Total Downloads](https://camo.githubusercontent.com/2b46c851d791cae27d5817841118f28adaae98cd5ebe0427678f219b5ff2a8a1/68747470733a2f2f706f7365722e707567782e6f72672f6c6172617669652f7072656469732d6173796e632f646f776e6c6f616473)](https://packagist.org/packages/laravie/predis-async)[![Latest Unstable Version](https://camo.githubusercontent.com/c61bfc45ebbd31d9e5b4972acc3b861438109b9a177431ba6f803fcf784e85f8/68747470733a2f2f706f7365722e707567782e6f72672f6c6172617669652f7072656469732d6173796e632f762f756e737461626c65)](https://packagist.org/packages/laravie/predis-async)[![License](https://camo.githubusercontent.com/33e42b1bb7f40e1fbd069daae9ea826a695a190bf34d443251b0bd18d2ddfb96/68747470733a2f2f706f7365722e707567782e6f72672f6c6172617669652f7072656469732d6173796e632f6c6963656e7365)](https://packagist.org/packages/laravie/predis-async)[![Coverage Status](https://camo.githubusercontent.com/24b6b838ee423abd79dcf22ae6e71c51f0d2d09a07a2af8c67740e84706eccc8/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6c6172617669652f7072656469732d6173796e632f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/laravie/predis-async?branch=master)

Asynchronous (non-blocking) version of [Predis](https://github.com/nrk/predis), the full-featured PHP client library for [Redis](http://redis.io), built on top of [React](http://reactphp.org/) to handle evented I/O. By default Predis\\Async does not require any additional C extension to work, but it can be optionally paired with [phpiredis](https://github.com/nrk/phpiredis) to sensibly lower the overhead of serializing and parsing the Redis protocol.

Predis\\Async is currently under development but already works pretty well. The client foundation is being built on top of the event loop abstraction offered by [React](https://github.com/reactphp), an event-oriented framework for PHP that aims to provide everything needed to create reusable libraries and long-running applications using an evented approach powered by non-blocking I/O. This library is partially tested on [HHVM](http://www.hhvm.com), but support for this runtime should be considered experimental.

Contributions are highly welcome and appreciated, feel free to open pull-requests with fixes or just [report issues](https://github.com/laravie/predis-async/issues) if you encounter weird behaviors and blatant bugs.

Main features
-------------

[](#main-features)

- Wide range of Redis versions supported (from **2.0** to **3.0** and **unstable**) using profiles.
- Transparent key prefixing for all known Redis commands using a customizable prefixing strategy.
- Abstraction for `MULTI` / `EXEC` transactions (Redis &gt;= 2.0).
- Abstraction for `PUBLISH` / `SUBSCRIBE` contexts (Redis &gt;= 2.0).
- Abstraction for `MONITOR` contexts (Redis &gt;= 1.2).
- Abstraction for Lua scripting (Redis &gt;= 2.6).
- Ability to connect to Redis using TCP/IP or UNIX domain sockets.
- Redis connections can be established lazily, commands are queued while the client is connecting.
- Flexible system for defining and registering custom sets of supported commands or profiles.

Installing
----------

[](#installing)

Predis\\Async is available on [Packagist](http://packagist.org/packages/predis/predis-async). It is not required to have the [phpiredis](https://github.com/nrk/phpiredis) extension loaded as suggested since the client will work anyway using a pure-PHP protocol parser, but if the extension is detected at runtime then it will be automatically preferred over the slower default. It is possible to force the client to use the pure-PHP protocol parser even when the extension is detected simply by passing `['phpiredis' => false]` in the array of client options.

Example
-------

[](#example)

```
