Skip to content

Commit d1ab9a2

Browse files
committed
add readme
1 parent 246e014 commit d1ab9a2

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,47 @@
1+
# Memcached cache implementation for react/cache
2+
13
[![Build Status](https://travis-ci.org/seregazhuk/php-react-cache-memcached.svg?branch=master)](https://travis-ci.org/seregazhuk/php-react-cache-memcached)
4+
5+
Implementation of [react/cache interface](https://github.com/reactphp/cache) that uses Memcached as a storage.
6+
7+
**Table of Contents**
8+
- [Installation](#installation)
9+
- [Quick Start](#quick-start)
10+
11+
## Installation
12+
13+
Library requires PHP 5.6.0 or above.
14+
15+
The recommended way to install this library is via [Composer](https://getcomposer.org).
16+
[New to Composer?](https://getcomposer.org/doc/00-intro.md)
17+
18+
See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades.
19+
20+
```
21+
composer require seregazhuk/react-cache-memcached
22+
```
23+
24+
## Quick Start
25+
26+
`React\Cache\CacheInterface` has three simple methods to store, retrieve and remove data:
27+
28+
use React\EventLoop\Factory;
29+
use seregazhuk\React\Cache\Memcached\Memcached;
30+
31+
$loop = Factory::create();
32+
$cache = new Memcached($loop);
33+
34+
// store
35+
$cache->set('key', 12345);
36+
37+
// retrieve
38+
$cache->get('key')->then(function($value){
39+
// handle data
40+
});
41+
42+
// ...
43+
44+
// remove
45+
$cache->remove('key');
46+
47+
$loop->run();

0 commit comments

Comments
 (0)