'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
(chain-gc-resources old-resource new-resource)
Chain an older resource to a newer (derived) one such that the older resource cannot get cleaned up before the newer resource.
Chain an older resource to a newer (derived) one such that the older resource cannot get cleaned up before the newer resource.
(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.
(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].
Internal implementation to differentiate between different forms of tracking resources.
Internal implementation to differentiate between different forms of tracking resources.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close