EventStreamSubscription class
A class representing a ResolvedEvent stream subscription.
This class maintains the state of the subscription, the progress along the stream, the stream of ResolvedEvents and SubscriptionDroppedEvent about the SubscriptionDroppedEvent.cause and SubscriptionDroppedEvent.reason why the subscription onDropped.
If you need to add multiple listeners to the stream, you should use asBroadcastStream. When you are finished using the subscription, you need to dispose it to close the connection to the server and release resources to prevent memory leaks.
This class maintains the state of the subscription, the progress along the stream, the stream of ResolvedEvents and SubscriptionDroppedEvent about the SubscriptionDroppedEvent.cause and SubscriptionDroppedEvent.reason why the subscription onDropped.
If you need to add multiple listeners to the stream, you should use asBroadcastStream. When you are finished using the subscription, you need to dispose it to close the connection to the server and release resources to prevent memory leaks.
- Implementers
Constructors
-
EventStreamSubscription(ReadEnumerator<
GeneratedMessage> enumerator, {SubscriptionResolvedEventCallback? onEventAppeared, SubscriptionDroppedCallback? onSubscriptionDropped, SubscriptionCheckpointCallback? checkpointReached}) - Constructs a new EventStreamSubscription
Properties
-
checkpoints
→ Stream<
SubscriptionCheckPoint> -
Stream of
SubscriptionCheckPoint
sno setter - hashCode → int
-
The hash code for this object.
no setterinherited
- isCompleted → bool
-
Check if operation has completed. Operation is completed when
all events are fetched with stream, or after dispose is called.
no setter
- isOK → bool
-
Check if read result is OK
no setter
- isStreamNotFound → bool
-
Check if stream was not found
no setter
-
onDropped
↔ Future<
SubscriptionDroppedEvent> -
Completes when SubscriptionDroppedReason is given
latefinal
- position → LogPosition
-
Get current LogPosition.
Returns LogPosition.end until first event is received.
no setter
- progress → StreamState
-
Current StreamState progress
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → ReadState
-
The StreamState after the operation.
no setter
-
stream
→ Stream<
ResolvedEvent> -
Get resolved events as single-subscriber stream
no setter
- streamId → String
-
Get StreamState.streamId
no setter
- subscriptionId → String?
-
The id of the EventStreamSubscription set by the server.
Returns null if subscription failed.
no setter
Methods
-
asBroadcastStream(
) → Stream< ResolvedEvent> - Get resolved events as broadcast stream
-
dispose(
) → Future< void> - Dispose subscription
-
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