A library for implementing resource pools.
A library for implementing resource pools.
Creates a factory from a URI by dispatching on the scheme.
Creates a factory from a URI by dispatching on the scheme.
(create! pool uri)Tries to retrieve and recycle an already created resource from the pool. If no resource can be found a new one is created.
Tries to retrieve and recycle an already created resource from the pool. If no resource can be found a new one is created.
(dispose! pool resource)(dispose! pool uri resource)Places a resource back in the pool or disposes it when maximum size is reached.
Places a resource back in the pool or disposes it when maximum size is reached.
(-create! this uri)Creates a new resource from a URI.
Creates a new resource from a URI.
(-dispose! this resource)Disposes a resource.
Disposes a resource.
(-recycle! this resource uri)Recycles an existing resource and assigns a URI.
Recycles an existing resource and assigns a URI.
(-valid? this resource)Tests if a resource is still valid.
Tests if a resource is still valid.
(make-pool & {:keys [max-size] :or {max-size 10}})Returns a new Ref with an empty hash map as initial value.
Returns a new Ref with an empty hash map as initial value.
(-uri->key this uri)Converts a URI to a keyword.
Converts a URI to a keyword.
(-uri this)Returns the URI of a resource.
Returns the URI of a resource.
(with-pool pool bindings & body)binding => [name uri ...] Evaluates body in a try expression with names bound to the values of the created resources. The finally clause calls dispose! on each name.
binding => [name uri ...] Evaluates body in a try expression with names bound to the values of the created resources. The finally clause calls dispose! on each name.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs | 
| ← | Move to previous article | 
| → | Move to next article | 
| Ctrl+/ | Jump to the search field |