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


*resource-context*clj


*resource-debug-double-free*clj


do-releaseclj

(do-release item)

ignoreclj

(ignore item)

Ignore specifically this resource.

Ignore specifically this resource.
raw 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
raw 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.
raw 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.
raw docstring

release-resource-seqclj

(release-resource-seq res-ctx & {:keys [pred]})

Release a resource context returned from return-resource-context.

Release a resource context returned from return-resource-context.
raw 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}
raw 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.
raw 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}
raw 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.
raw docstring

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

× close