Class LivePyObjectWrapper
java.lang.Object
io.deephaven.util.referencecounting.ReferenceCounted
io.deephaven.engine.liveness.ReferenceCountedLivenessReferent
io.deephaven.server.plugin.python.LivePyObjectWrapper
- All Implemented Interfaces:
LogOutputAppendable
,LivenessReferent
Provides a mapping between Python refcount and Deephaven's liveness mechanism, allowing liveness scopes to manage the
single strong reference that the PyObject
instance represents. This way, as long as PyObjectRefCountedNode instances are managed correctly by their parent
scope, the PyObject strong reference will be correctly released when the object is no longer used.
This class is experimental, and may be changed or moved in a future release to a new package.
- See Also:
-
Constructor Summary
ConstructorDescriptionLivePyObjectWrapper
(@NotNull org.jpy.PyObject pythonObject) Constructs a PyObjectRefCountedNode instance by wrapping a PyObject. -
Method Summary
Methods inherited from class io.deephaven.engine.liveness.ReferenceCountedLivenessReferent
dropReference, getWeakReference, onReferenceCountAtZero, tryRetainReference
Methods inherited from class io.deephaven.util.referencecounting.ReferenceCounted
append, decrementReferenceCount, forceReferenceCountToZero, getReferenceCountDebug, incrementReferenceCount, resetReferenceCount, toString, tryDecrementReferenceCount, tryIncrementReferenceCount
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.deephaven.engine.liveness.LivenessReferent
getReferentDescription, retainReference
-
Constructor Details
-
LivePyObjectWrapper
Constructs a PyObjectRefCountedNode instance by wrapping a PyObject. The caller should ensure that an appropriate liveness scope is open to retain this instance.
-
-
Method Details
-
destroy
protected void destroy()Description copied from class:ReferenceCountedLivenessReferent
Attempt to release (destructively when necessary) resources held by this object. This may render the object unusable for subsequent operations. Implementations should be sure to call super.destroy().This is intended to only ever be used as a side effect of decreasing the reference count to 0.
- Overrides:
destroy
in classReferenceCountedLivenessReferent
-
getPythonObject
Returns the PyObject instance tracked by this object. -
equals
-
hashCode
public int hashCode()
-