Liking cljdoc? Tell your friends :D

clj-xmemcached.core

The clj-xmemcached core

The clj-xmemcached core
raw docstring

*memcached-client*clj

source

->clj_json_transcoderclj

(->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.
sourceraw docstring

->nippy_transcoderclj

(->nippy_transcoder)

Positional factory function for class clj_xmemcached.core.nippy_transcoder.

Positional factory function for class clj_xmemcached.core.nippy_transcoder.
sourceraw docstring

addclj

(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.
sourceraw docstring

appendclj

(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
sourceraw docstring

byte-array-classclj

source

bytes?clj

(bytes? x)
source

casclj

(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)
sourceraw docstring

clj-json-transcoderclj

source

Compressorcljprotocol

compressclj

(compress this bs)

Compress byte array.

Compress byte array.

decompressclj

(decompress this bs)

Decompress byte array.

Decompress byte array.
source

decrclj

(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
sourceraw docstring

def-transcodercljmacro

(def-transcoder name & body)
source

default-compressorclj

source

define-incr-decr-fncljmacro

(define-incr-decr-fn meta name)
source

define-store-fncljmacro

(define-store-fn meta name)
source

deleteclj

(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].
sourceraw docstring

flush-allclj

(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.
sourceraw docstring

getclj

(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
sourceraw docstring

get-memcached-clientclj

(get-memcached-client)
source

getsclj

(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
sourceraw docstring

incrclj

(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
sourceraw docstring

memcachedclj

(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.
sourceraw docstring

MemcachedTranscodercljprotocol

mashallclj

(mashall this obj)

Encode object into a byte array

Encode object into a byte array

unmashallclj

(unmashall this bs)

Decode a byte array to a object.

Decode a byte array to a object.
source

nippy-transcoderclj

source

no-client-errorclj

source

prependclj

(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
sourceraw docstring

replaceclj

(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
sourceraw docstring

setclj

(set key value)
(set key value expire)

Set an item with key and value.

Set an item with key and value.
sourceraw docstring

set-client!clj

(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
sourceraw docstring

shutdownclj

(shutdown)
(shutdown cli)

Shutdown the memcached client

Shutdown the memcached client
sourceraw docstring

statsclj

(stats)
(stats cli)

Get statistics info from all memcached servers

Get statistics info from all memcached servers
sourceraw docstring

throughcljmacro

(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)) 
sourceraw docstring

touchclj

(touch key expire)

Touch a item with new expire time.

Touch a item with new expire time.
sourceraw docstring

try-lockcljmacro

(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))
sourceraw docstring

with-clientcljmacro

(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.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close