Documentation ¶
Overview ¶
cache for zkocc
Index ¶
Constants ¶
View Source
const ( // DISCONNECTED: initial state of the cell. // connect will only work in that state, and will go to CONNECTING CELL_DISCONNECTED = iota // CONNECTING: a 'connect' function started the connection process. // It will then go to CONNECTED or BACKOFF. Only one connect // function will run at a time. // requests will be blocked until the state changes (if it goes to // CONNECTED, request will then try to get the value, if it goes to // CELL_BACKOFF, they will fail) CELL_CONNECTING // steady state, when all is good and dandy. CELL_CONNECTED // BACKOFF: we're waiting for a bit before trying to reconnect. // a go routine will go to DISCONNECTED and start login soon. // we're failing all requests in this state. CELL_BACKOFF )
Our state. We need this to be independent as we want to decorelate the connection from what clients are asking for. For instance, if a cell is not used often, and gets disconnected, we want to reconnect in the background, independently of the clients. Also we want to support a BACKOFF mode for fast client failure reporting while protecting the server from high rates of connections.
Variables ¶
View Source
var ( ErrPartialRead = errors.New("zkocc: partial read") ErrLocalCell = errors.New("zkocc: cannot resolve local cell") )
Functions ¶
This section is empty.
Types ¶
type ZkCache ¶
type ZkCache struct { Cache map[string]*zkCacheEntry // contains filtered or unexported fields }
the ZkCache is a map from resolved zk path (where 'local' has been replaced with the cell name) to the entry
Click to show internal directories.
Click to hide internal directories.