Subscription class
Represents a subscription to a Bayeux channel
Constructors
- Subscription.new({required String id, required Channel channel, required SubscriptionCallback callback})
Properties
- active → bool
-
Whether this subscription is active
no setter
- age → int
-
Age of subscription in milliseconds
no setter
- callback → SubscriptionCallback
-
Callback function to handle messages
final
- channel → Channel
-
Channel being subscribed to
final
- createdAt → DateTime
-
Timestamp when subscription was created
final
- errorCount → int
-
Error count
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- id → String
-
Unique subscription ID
final
- lastUsed → DateTime?
-
Timestamp when subscription was last used
no setter
- messageCount → int
-
Number of messages received
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
statistics
→ Map<
String, dynamic> -
Get subscription statistics
no setter
- successRate → double
-
Success rate (messages vs errors)
no setter
- timeSinceLastUse → int?
-
Time since last use in milliseconds
no setter
Methods
-
cancel(
) → void - Cancel this subscription
-
handleError(
dynamic error) → void - Handle an error for this subscription
-
handleMessage(
dynamic data) → void - Handle a message for this subscription
-
matches(
Channel channel) → bool - Check if this subscription matches a channel
-
matchesChannel(
String channelName) → bool - Check if this subscription matches a channel name
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reactivate(
) → void - Reactivate this subscription
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override