Liking cljdoc? Tell your friends :D

tech.resource

'off-heap' resource management. Default management is stack based management but gc or a combination of the two is possible. To declare a stack region use stack-resource-context. No matter how the context unwinds, stack resources declared within will be released.

More options for stack based resources available at tech.resource.stack.

For GC resources, users must not reference the tracked object in the dispose function else the circular dependency will keep the object in the gc's live set

'off-heap' resource management.  Default management is stack based management but gc
or a combination of the two is possible.  To declare a stack region use
stack-resource-context.  No matter how the context unwinds, stack resources declared
within will be released.

More options for stack based resources available at tech.resource.stack.

For GC resources, users must not reference the tracked object in the dispose function
else the circular dependency will keep the object in the gc's live set
raw docstring

stack-resource-contextcljmacro

(stack-resource-context & body)

Stack resource context. When this context unwinds, stack resource declared within will be released.

Stack resource context.  When this context unwinds, stack resource declared within
will be released.
sourceraw docstring

trackclj

(track item & [dispose-fn track-type])

Track a resource. If the item inherents from PResource or is a clojure fn, or a Runnable object then it can be cleaned up by the stack system with no further dispose function. Objects tracked by the gc need to have a dispose fn that does not reference the tracked object. Track types can be :gc, :stack, or [:gc :stack].

Track a resource.  If the item inherents from PResource or is a clojure fn, or a
Runnable object then it can be cleaned up by the stack system with no further dispose
function.  Objects tracked by the gc need to have a dispose fn that does *not*
reference the tracked object.
Track types can be :gc, :stack, or [:gc :stack].
sourceraw docstring

track-implcljmultimethod

Internal implementation to differentiate between different forms of tracking resources.

Internal implementation to differentiate between different forms of tracking
resources.
sourceraw docstring

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

× close