Package net.carcdr.ycrdt.jni
Class JniYSubscription
java.lang.Object
net.carcdr.ycrdt.jni.JniYSubscription
- All Implemented Interfaces:
AutoCloseable,net.carcdr.ycrdt.YSubscription
Represents an active observer subscription.
Subscriptions should be closed when no longer needed to prevent memory leaks. Use try-with-resources for automatic cleanup:
try (YSubscription sub = text.observe(event -> { ... })) {
// Observer is active
text.insert(0, "Hello");
} // Observer automatically unregistered
- See Also:
-
Method Details
-
getSubscriptionId
public long getSubscriptionId()- Specified by:
getSubscriptionIdin interfacenet.carcdr.ycrdt.YSubscription
-
getObserver
public net.carcdr.ycrdt.YObserver getObserver()- Specified by:
getObserverin interfacenet.carcdr.ycrdt.YSubscription
-
getTarget
- Specified by:
getTargetin interfacenet.carcdr.ycrdt.YSubscription
-
isClosed
public boolean isClosed()- Specified by:
isClosedin interfacenet.carcdr.ycrdt.YSubscription
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfacenet.carcdr.ycrdt.YSubscription
-