The clj-xmemcached core
The clj-xmemcached core
(->clj_json_transcoder)
Positional factory function for class clj_xmemcached.core.clj_json_transcoder.
Positional factory function for class clj_xmemcached.core.clj_json_transcoder.
(->nippy_transcoder)
Positional factory function for class clj_xmemcached.core.nippy_transcoder.
Positional factory function for class clj_xmemcached.core.nippy_transcoder.
(add key value)
(add key value expire)
Add an item with key and value,success only when item is not exists.
Add an item with key and value,success only when item is not exists.
(append key value)
Append a string to an existing item's value by key
Append a string to an existing item's value by key
(cas key cas-fn)
(cas key cas-fn max-times)
(cas key cas-fn max-times expire)
Compare and set an item's value by key set the new value to: (cas-fn current-value)
Compare and set an item's value by key set the new value to: (cas-fn current-value)
(compress this bs)
Compress byte array.
Compress byte array.
(decompress this bs)
Decompress byte array.
Decompress byte array.
(decr key__2796__auto__ delta__2797__auto__)
(decr key__2796__auto__ delta__2797__auto__ init__2798__auto__)
(decr key__2796__auto__
delta__2797__auto__
init__2798__auto__
expire__2799__auto__)
Decrease an item's value by key
Decrease an item's value by key
(delete key)
(delete key cas)
Delete an item by key [with CAS values that was get in binary protocol].
Delete an item by key [with CAS values that was get in binary protocol].
(flush-all)
(flush-all cli)
Flush all values in memcached.WARNNING:this method will remove all items in memcached.
Flush all values in memcached.WARNNING:this method will remove all items in memcached.
(get k)
(get k1 k2)
(get k1 k2 & ks)
Get items by a key or many keys,when bulk get items,the result is java.util.HashMap
Get items by a key or many keys,when bulk get items,the result is java.util.HashMap
(gets key)
Gets an item's value by key,return value has a cas value
Gets an item's value by key,return value has a cas value
(incr key__2796__auto__ delta__2797__auto__)
(incr key__2796__auto__ delta__2797__auto__ init__2798__auto__)
(incr key__2796__auto__
delta__2797__auto__
init__2798__auto__
expire__2799__auto__)
Increase an item's value by key
Increase an item's value by key
(memcached servers & opts)
Create a memcached client with zero or more options(any order): :protocol Protocol to talk with memcached,a keyword in :text,:binary or :kestrel,default is text. :hash Hash algorithm,a keyword in :consistent, :standard or :php, default is standard hash. :pool Connection pool size,default is 1,it's a recommended value. :sanitize-keys Whether to sanitize keys before operation,default is false. :reconnect Whether to reconnect when connections are disconnected,default is true. :transcoder Transcoder to encode/decode data. :session-locator memcached connection locator,default is created by :hash algorithm value. :heartbeat Whether to do heartbeating when connections are idle,default is true. :timeout Operation timeout in milliseconds,default is five seconds. :compress-threshold Value compression threhold in bytes, default is 16K. :name A name to define a memcached client instance :selector-pool-size Reactor pool size for every client instance, it's computed based on CPUs number by default.
Create a memcached client with zero or more options(any order): :protocol Protocol to talk with memcached,a keyword in :text,:binary or :kestrel,default is text. :hash Hash algorithm,a keyword in :consistent, :standard or :php, default is standard hash. :pool Connection pool size,default is 1,it's a recommended value. :sanitize-keys Whether to sanitize keys before operation,default is false. :reconnect Whether to reconnect when connections are disconnected,default is true. :transcoder Transcoder to encode/decode data. :session-locator memcached connection locator,default is created by :hash algorithm value. :heartbeat Whether to do heartbeating when connections are idle,default is true. :timeout Operation timeout in milliseconds,default is five seconds. :compress-threshold Value compression threhold in bytes, default is 16K. :name A name to define a memcached client instance :selector-pool-size Reactor pool size for every client instance, it's computed based on CPUs number by default.
(mashall this obj)
Encode object into a byte array
Encode object into a byte array
(unmashall this bs)
Decode a byte array to a object.
Decode a byte array to a object.
(prepend key value)
Prepend a string to an existing item's value by key
Prepend a string to an existing item's value by key
(replace key value)
(replace key value expire)
Replace an existing item's value by new value
Replace an existing item's value by new value
(set key value)
(set key value expire)
Set an item with key and value.
Set an item with key and value.
(set-client! client)
Set a global memcached client for all thread contexts,prefer binding a client by with-client
macro
Set a global memcached client for all thread contexts,prefer binding a client by `with-client` macro
(shutdown)
(shutdown cli)
Shutdown the memcached client
Shutdown the memcached client
(stats)
(stats cli)
Get statistics info from all memcached servers
Get statistics info from all memcached servers
(through key load)
(through key expire load)
A macro to get item from cache or cache the value evaluated by load cause. For example,you want to get the user from memcached if it is exists in cache or load it from database to memcached and return it:
(through uid 60 (load-user-from-db uid))
A macro to get item from cache or cache the value evaluated by load cause. For example,you want to get the user from memcached if it is exists in cache or load it from database to memcached and return it: (through uid 60 (load-user-from-db uid))
(touch key expire)
Touch a item with new expire time.
Touch a item with new expire time.
(try-lock key expire then)
(try-lock key expire then else)
Lightweight distribution lock. Try to lock with the global key,if gettting lock successfully, then do something, else do other things.For example,get the global lock to initial in 5 seconds:
(try-lock "init-lock" 5000 (start-service))
Lightweight distribution lock. Try to lock with the global key,if gettting lock successfully, then do something, else do other things.For example,get the global lock to initial in 5 seconds: (try-lock "init-lock" 5000 (start-service))
(with-client client & body)
Evalutes body in the context of a thread-bound client to a memcached server.
Evalutes body in the context of a thread-bound client to a memcached server.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close