File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Memcached cache implementation for react/cache
2
+
1
3
[ ![ 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();
You can’t perform that action at this time.
0 commit comments