Class JniYSubscription

java.lang.Object
net.carcdr.ycrdt.jni.JniYSubscription
All Implemented Interfaces:
AutoCloseable, net.carcdr.ycrdt.YSubscription

public final class JniYSubscription extends Object implements 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:
  • YObserver