deephaven.liveness_scope

This module gives the users a finer degree of control over when to clean up unreferenced nodes in the query update graph instead of solely relying on garbage collection.

class LivenessScope(j_scope)[source]

Bases: deephaven._wrapper.JObjectWrapper

A LivenessScope automatically manages reference counting of tables and other query resources that are created in it. It should not be instantiated directly but rather through the ‘liveness_scope’ context manager.

j_object_type

alias of io.deephaven.engine.liveness.LivenessScope

preserve(wrapper)[source]

Preserves a query graph node (usually a Table) to keep it live for the outer scope.

Return type

None

liveness_scope()[source]

Creates a LivenessScope for running a block of code and releases all the query graph resources upon exit. It can be used in a nested way.

Return type

LivenessScope

Returns

a LivenessScope