AdvancedPublisher class

A zenoh advanced publisher with cache, publisher detection, and sample miss detection capabilities.

Wraps ze_owned_advanced_publisher_t. Call close when done to undeclare the publisher 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.

It carries a NativeFinalizer safety net: if it is dropped without an explicit release, its native resources are reclaimed when the object is collected. ⛔ The net is not a substitute for releasing it explicitly — a finalizer runs at an unpredictable time, or not at all if the program exits first.

Implemented types

Constructors

AdvancedPublisher.declare(Pointer<Void> loanedSession, Pointer<Void> loanedKe, String keyExpr, {bool enableCache = false, int? cacheMaxSamples, bool publisherDetection = false, bool sampleMissDetection = false, HeartbeatMode heartbeatMode = HeartbeatMode.none, int heartbeatPeriodMs = 0, bool enableMatchingListener = false})
Creates an advanced publisher on the given session and key expression.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
keyExpr String
The key expression this advanced publisher is declared on.
no setter
matchingStatus Stream<bool>?
A stream of matching-status changes, or null if AdvancedPublisherOptions.enableMatchingListener was not set when this publisher was declared.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() → void
Undeclares the advanced publisher and releases native resources.
deleteResource() → void
Sends a DELETE through this advanced publisher.
hasMatchingSubscribers() bool
Returns whether any subscribers currently match this advanced publisher's key expression.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
put(String value, {Encoding? encoding, ZBytes? attachment}) → void
Publishes a string value through this advanced publisher.
putBytes(ZBytes payload, {Encoding? encoding, ZBytes? attachment}) → void
Publishes ZBytes payload through this advanced publisher.
toString() String
A string representation of this object.
inherited

Operators

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