Liking cljdoc? Tell your friends :D

tech.v3.resource.stack

Implementation of stack based resource system. Simple, predictable, deterministic, and applicable to most problems. Resource contexts are sequences of resources that need to be, at some point, released.

Implementation of stack based resource system.  Simple, predictable, deterministic,
and applicable to most problems.  Resource contexts are sequences of resources that
need to be, at some point, released.
raw docstring

*bound-resource-context?*clj

source

*resource-context*clj

source

*resource-debug-double-free*clj

source

do-releaseclj

(do-release item)
source

ignoreclj

(ignore item)

Ignore specifically this resource.

Ignore specifically this resource.
sourceraw docstring

ignore-resourcesclj

(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
sourceraw docstring

releaseclj

(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.
sourceraw docstring

release-current-resourcesclj

(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.
sourceraw docstring

release-resource-seqclj

(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.
sourceraw docstring

return-resource-seqcljmacro

(return-resource-seq & body)

Run code and return both the return value and the resources the code created. Returns: {:return-value retval :resource-seq resources}

Run code and return both the return value and the resources the code created.
Returns:
{:return-value retval
:resource-seq resources}
sourceraw docstring

trackclj

(track item)
(track item dispose-fn)

Begin tracking this resource. Resource be released when current resource context ends. If the item satisfies the PResource protocol, then it can be tracked itself. Else the dispose function is tracked.

Begin tracking this resource. Resource be released when current resource context
ends.  If the item satisfies the PResource protocol, then it can be tracked
itself.  Else the dispose function is tracked.
sourceraw docstring

with-bound-resource-seqcljmacro

(with-bound-resource-seq resource-seq & body)

Run code and return both the return value and the (updated,appended) resources created. Returns: {:return-value retval :resource-seq resources}

Run code and return both the return value and the (updated,appended) resources
created.
Returns:
{:return-value retval
:resource-seq resources}
sourceraw docstring

with-resource-contextcljmacro

(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.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close