Liking cljdoc? Tell your friends :D

hitchhiker.tree.bootstrap.redis

Description of refcounting system in redis

The refcounting system allows any key in redis to be managed by refcounting. This refcounter doesn't do cycle protection, but weakrefs would be very simple to add.

To have a key point to another, we call add-refs with the pointer key and list of pointee keys. Usually, the pointer key would be a struct with children.

Each key which is pointed to has an auxiliary key, which has the same name but ends in :rc. This is an int of the refcount of the key; the system deletes the key when its refcount reaches 0.

Each key which is a pointer has an auxiliary key, which has the same name but ends in :rl. This is the list of keys that we have a reference, or pointer, to. rl=reflist. This list is used when the pointer is finally deleted--every key which the pointer points to must have its refcount decremented, and if any refcount reaches 0, that key must too be deleted.

To reduce the frequency that keys are orphaned, we allow for new roots to be marked by the new-root function. This function stores the given key as a newly created root pointer, which is put onto a list with its creation time. Somehow, we track when root pointers are older than a certain time, so that we can delete them automatically.

Description of refcounting system in redis

The refcounting system allows any key in redis to be managed
by refcounting. This refcounter doesn't do cycle protection, but
weakrefs would be very simple to add.

To have a key point to another, we call add-refs with the pointer key
and list of pointee keys. Usually, the pointer key would be a struct
with children.

Each key which is pointed to has an auxiliary key, which has the same name
but ends in :rc. This is an int of the refcount of the key; the system
deletes the key when its refcount reaches 0.

Each key which is a pointer has an auxiliary key, which has the same name
but ends in :rl. This is the list of keys that we have a reference, or pointer, to.
rl=reflist. This list is used when the pointer is finally deleted--every
key which the pointer points to must have its refcount decremented, and if
any refcount reaches 0, that key must too be deleted.

To reduce the frequency that keys are orphaned, we allow for new roots to
be marked by the new-root function. This function stores the given key as a
newly created root pointer, which is put onto a list with its creation time.
Somehow, we track when root pointers are older than a certain time, so that
we can delete them automatically.
raw docstring

add-refsclj

(add-refs node-key children-keys)
source

add-to-expiryclj

(add-to-expiry key when-to-expire)

Takes a refcounting key and a time for that key to expire

Takes a refcounting key and a time for that key to expire
sourceraw docstring

create-tree-from-root-keyclj

(create-tree-from-root-key root-key)
source

drop-refclj

(drop-ref key)
source

drop-ref-luaclj

The string of the drop-ref function in lua. Returns the code in a local function with the named drop_ref

The string of the drop-ref function in lua. Returns the code in a local
function with the named drop_ref
sourceraw docstring

get-next-expiryclj

(get-next-expiry now)

Given the current time, returns the next expiry time

Given the current time, returns the next expiry time
sourceraw docstring

get-root-keyclj

(get-root-key tree)
source

redis-addrclj

(redis-addr last-key redis-key)
source

RedisAddrclj

source

RedisBackendclj

source

seed-cache!clj

(seed-cache! redis-key val)
source

start-expiry-thread!clj

(start-expiry-thread!)
source

synthesize-storage-addrclj

(synthesize-storage-addr key)

Given a key, returns a promise containing that key for use as a storage-addr

Given a key, returns a promise containing that key for use as a storage-addr
sourceraw docstring

totally-fetchclj

(totally-fetch redis-key)
source

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

× close