(conn-pool connector cmds-fn)
(conn-pool {:keys [redis-client stateful-conn codec] :as connector}
cmds-fn
options)
Create a ConnectionPoolImpl that wraps a ConnectionPoolSupport. Takes a connector and a command function that will be called on pooled connections. Last parameter (options) allows to fully customize your pool based on Apache2 GenericObjectPoolConfig; you have two options: pass a map with keys max-idle, min-idle and max-total or a org.apache.commons.pool2.impl.GenericObjectPoolConfig
Create a ConnectionPoolImpl that wraps a ConnectionPoolSupport. Takes a connector and a command function that will be called on pooled connections. Last parameter (options) allows to fully customize your pool based on Apache2 GenericObjectPoolConfig; you have two options: pass a map with keys max-idle, min-idle and max-total or a org.apache.commons.pool2.impl.GenericObjectPoolConfig
Functions for using the connection pool
Functions for using the connection pool
(borrow-conn this)
(close this)
(return-conn this conn)
(pool-config {:keys [max-total max-idle min-idle]
:or {max-total GenericObjectPoolConfig/DEFAULT_MAX_TOTAL
max-idle GenericObjectPoolConfig/DEFAULT_MAX_IDLE
min-idle GenericObjectPoolConfig/DEFAULT_MIN_IDLE}})
Internal helper to build GenericObjectPoolConfig from a map
Internal helper to build GenericObjectPoolConfig from a map
(with-conn-pool conn-pool cmds-name & body)
Takes a ConnectionPool coon-pool
and a cmds-name
symbol that will be bound to
the command function of the pool called on a borrowed connection
Takes a ConnectionPool `coon-pool` and a `cmds-name` symbol that will be bound to the command function of the pool called on a borrowed connection
(with-conn-pool* conn-pool cmds-name conn-name & body)
Like with-conn-pool but also binds the pooled connection to conn-name
.
User is responsible for returning it to the pool within body
Like with-conn-pool but also binds the pooled connection to `conn-name`. User is responsible for returning it to the pool within `body`
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close