Python client for Infinispan key-value store. Currently supported features:
get
, put
, remove
, contains_key
.put_if_absent
, replace
, replace_with_version
, get_with_version
, get_with_metadata
.lifespan='1m', max_idle='1d'
.previous=True
option.stats
operation.put
is blocking, put_async
is non-blocking and returns a Future).from infinispan import Infinispan
with Infinispan(host='127.0.0.1', port=11222) as client:
client.put("key1", "value1")
value, version = client.get_with_version("key1")
prev_val = client.replace_with_version("key1", value, version, lifespan='1d', previous=True)
stats_f = client.stats_async()
# ...
print prev_val
print stats_f.result()