Subscription class

A subscription to a channel.

Constructors

Subscription(SubscriptionOptions options)

Properties

channel String
Returns the channel name for this subscription.
no setter
handlerCount int
Returns the number of registered handlers.
no setter
hashCode int
The hash code for this object.
no setterinherited
isCreated bool
Returns if the subscription is created or not.
no setter
isDeleted bool
Returns if the subscription is deleted or not.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stream Stream
Get a stream of messages for this subscription. This is the idiomatic Dart way to listen for messages.
no setter

Methods

$runHandler(dynamic message) → void
Run all registered handlers for the subscription. This is an internal method exposed for testing.
create() Future<void>
Create the subscription on the server.
delete() Future<void>
Delete the subscription from the server.
forceCreate() Future<void>
Force create the subscription, waiting for connection if needed.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onMessage<T>(void handler(T)) → void Function()
Register a message handler. Returns a function to unsubscribe.
onMessageOnce<T>(void handler(T)) → void
Register a message handler that runs only once.
streamAs<T>() Stream<T>
Get a typed stream of messages for this subscription.
toString() String
A string representation of this object.
inherited

Operators

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