AdvancedSubscriber class

An advanced subscriber with history recovery and miss detection.

Wraps ze_owned_advanced_subscriber_t. Samples are delivered asynchronously via a Stream. Call close when done to undeclare the subscriber and release native resources.

This object holds a native handle, so it cannot cross an isolate boundary: a copy would share this one's native address while carrying its own fresh disposal flag, and the second release would be a use-after-free. Sending it throws ArgumentError naming the class.

No NativeFinalizer is attached to this class, deliberately: as Subscriber — the stream a user holds does not reference this wrapper, so it is collected while still in use. Releasing it explicitly is therefore the only thing that reclaims it.

Implemented types

Constructors

AdvancedSubscriber.declare(Pointer<Void> loanedSession, Pointer<Void> loanedKe, String keyExpr, {AdvancedSubscriberOptions options = const AdvancedSubscriberOptions()})
Creates an advanced subscriber on the given session and key expression.
factory

Properties

detectedPublishers Stream<Sample>?
A stream of matching advanced publishers appearing and disappearing, or null if AdvancedSubscriberOptions.detectPublishers was not set.
no setter
hashCode int
The hash code for this object.
no setterinherited
keyExpr String
The key expression this advanced subscriber is declared on.
no setter
missEvents Stream<MissEvent>?
A stream of MissEvents when samples are missed, or null if the miss listener was not enabled.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stream Stream<Sample>
A stream of Samples received by this advanced subscriber.
no setter

Methods

close() → void
Undeclares the advanced subscriber and releases native resources.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited