(ignore item)
Ignore specifically this resource.
Ignore specifically this resource.
(ignore-resources pred)
Ignore these resources for which pred returns true and do not track them. They will not be released unless added again with track
Ignore these resources for which pred returns true and do not track them. They will not be released unless added again with track
(make-resource release-fn!)
Make a releaser out of an arbitrary closure
Make a releaser out of an arbitrary closure
(release item)
Release this resource and remove it from tracking. Exceptions propagate to callers.
Release this resource and remove it from tracking. Exceptions propagate to callers.
(release-current-resources)
(release-current-resources pred)
Release all resources matching either a predicate or all resources currently tracked. Returns any exceptions that happened during release but continues to attempt to release anything else in the resource list.
Release all resources matching either a predicate or all resources currently tracked. Returns any exceptions that happened during release but continues to attempt to release anything else in the resource list.
(release-resource-seq res-ctx & {:keys [pred] :or {pred identity}})
Release a resource context returned from return-resource-context.
Release a resource context returned from return-resource-context.
(return-resource-context & body)
Run code an return both the return value and the resources the code created. Returns [retval resource-seq]. Note these resources will need to be released.
Run code an return both the return value and the resources the code created. Returns [retval resource-seq]. Note these resources will need to be released.
(safe-create resource-atom create-fn)
Create a resource and assign it to an atom. Allows threadsafe implementation of singelton type resources. Implementations need to take care that in the case of conflict their resource may be destroyed when the atom has not been set yet so their release-resource implementation needs to use compare-and-set! instead of reset! in order to clear the atom
Create a resource and assign it to an atom. Allows threadsafe implementation of singelton type resources. Implementations need to take care that in the case of conflict their resource may be destroyed when the atom has not been set yet so their release-resource implementation needs to use compare-and-set! instead of reset! in order to clear the atom
(track item)
Begin tracking this resource. Resource be released when current resource context ends
Begin tracking this resource. Resource be released when current resource context ends
(with-resource-context & body)
Begin a new resource context. Any resources added while this context is open will be released when the context ends.
Begin a new resource context. Any resources added while this context is open will be released when the context ends.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close