diff options
| author | John Anderson <sontek@gmail.com> | 2015-06-20 13:21:21 -0700 |
|---|---|---|
| committer | John Anderson <sontek@gmail.com> | 2015-06-20 13:21:21 -0700 |
| commit | f394d42966f4c98e9e74a62def7f6a98f0dfcb10 (patch) | |
| tree | 829559c58c412495ef6c91dae4b1cf38110bec73 /docs | |
| parent | e905884ede997ef14e53e64f507123513c6d9856 (diff) | |
| download | pymemcache-f394d42966f4c98e9e74a62def7f6a98f0dfcb10.tar.gz | |
Initial implementation of the hash client
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/getting_started.rst | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/docs/getting_started.rst b/docs/getting_started.rst index 68125fc..10b66c1 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -7,12 +7,29 @@ Basic Usage .. code-block:: python - from pymemcache.client import Client + from pymemcache.client.base import Client client = Client(('localhost', 11211)) client.set('some_key', 'some_value') result = client.get('some_key') +Using a memcached cluster +------------------------- +This will use a consistent hashing algorithm to choose which server to +set/get the values from. It will also automatically rebalance depending +on if a server goes down. + +.. code-block:: python + + from pymemcache.client.hash import HashClient + + client = HashClient([ + ('127.0.0.1', 11211), + ('127.0.0.1', 11212) + ]) + client.set('some_key', 'some value') + result = client.get('some_key') + Serialization -------------- @@ -20,7 +37,7 @@ Serialization .. code-block:: python import json - from pymemcache.client import Client + from pymemcache.client.base import Client def json_serializer(key, value): if type(value) == str: |
