SampleChannel class
The ReceivePort / StreamController pair behind every sample-carrying surface, plus the delivered-tracking that a retained payload needs.
Modelled directly on QueryChannel, which solved the same problem for the
query column: a carrier that hands a caller an object backed by native
memory must track what it has delivered, because only the undelivered
ones have no other owner.
⛔ Why the filter is armed by the flag rather than applied always
QueryChannel can write its stream as
_controller.stream.where(_undelivered.remove) because every query it
parses enters the set. Samples do not: with
retention off no handle exists and nothing is ever added, so that same
filter would return false for every sample and the subscriber would
deliver nothing at all. Arming it on the flag is what makes the shape
transfer — and it is also why retention-off carriers pay nothing here: no
set, no filter, no per-sample work.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- receivePort → ReceivePort
-
The port the C shim posts sample messages to.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
stream
→ Stream<
Sample> -
Samples as the consumer sees them.
no setter
Methods
-
abandon(
) → void - Tears the channel down when the declaration itself failed.
-
closeAndDrain(
) → void - Releases every retained handle that arrived but was never delivered, then closes.
-
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