Subscriber class

A zenoh subscriber that receives samples on a key expression.

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

Constructors

Subscriber.fromParts(Pointer<Void> ptr, ReceivePort receivePort, StreamController<Sample> controller)
Creates a Subscriber from a pre-allocated native handle and a sample channel pair.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stream Stream<Sample>
A stream of Samples received by this subscriber.
no setter

Methods

close() → void
Undeclares the 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

Static Methods

createSampleChannel() → (ReceivePort, StreamController<Sample>)
Sets up a ReceivePort and StreamController pair that parses incoming NativePort sample messages into Sample objects.
declare(Pointer<Void> loanedSession, Pointer<Void> loanedKe) Subscriber
Creates a subscriber on the given session and key expression.