(assoc-new-resource {:keys [resources init] :as pool})
(get-resource {:keys [init high resources] :as pool})
Low level resource getting process. Use with-resource macro instead.
Low level resource getting process. Use with-resource macro instead.
(mk-pool high low f-init f-close)
Make a mutable resource pool.
Make a mutable resource pool.
(mk-pool* high low f-init f-close)
Make a new resource pool where high for high watermark, low for low watermark, f-init is a function without argument to open a new resource, f-close is a function which take resource as a argument and do something to release the resource, the return value of f-close will be ignored.
Make a new resource pool where high for high watermark, low for low watermark, f-init is a function without argument to open a new resource, f-close is a function which take resource as a argument and do something to release the resource, the return value of f-close will be ignored.
(new-resource f-init resources)
Make a new resource of a pool
Make a new resource of a pool
(release-resource {:keys [low close resources] :as pool}
{res-id :id :as resource})
Low level resource releasing. Use with-resource macro instead.
Low level resource releasing. Use with-resource macro instead.
(shutdown-pool ref-pool)
Shutdown a mutable resource pool
Shutdown a mutable resource pool
(shutdown-pool* {:keys [resources close]})
Intenal function, to shutdown a resource pool.
Intenal function, to shutdown a resource pool.
(with-resource [res-name ref-pool] & body)
Get a resource from a pool, bind it to res-name, so you can use it in body, after body finish, the resource will be returned to the pool.
Get a resource from a pool, bind it to res-name, so you can use it in body, after body finish, the resource will be returned to the pool.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close