SubscriptionManager class

Manages the lifecycle of event subscriptions with automatic cleanup and tracking.

Constructors

SubscriptionManager({required NostrLogger logger})
Manages the lifecycle of event subscriptions with automatic cleanup and tracking.

Properties

hashCode int
The hash code for this object.
no setterinherited
logger NostrLogger
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

closeAllSubscriptions() → void
Close all subscriptions.
closeSubscription(String subscriptionId) → void
Close a subscription and perform cleanup.
dispose() → void
Clean up the manager resources.
extendAutoCloseTimer(String subscriptionId, Duration duration) → void
Extend the auto-close timer for a subscription.
getActiveSubscriptionCount() int
Get active subscription count.
getActiveSubscriptions() Map<String, SubscriptionMetadata>
Get all active subscriptions.
getStatistics() SubscriptionStatistics
Get subscription statistics.
getSubscription(String subscriptionId) SubscriptionMetadata?
Get a specific subscription by ID.
getSubscriptionsForRelay(String relayUrl) List<SubscriptionMetadata>
Get subscriptions for a specific relay.
isSubscriptionActive(String subscriptionId) bool
Check if a subscription is active.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerSubscription({required String subscriptionId, required List<NostrFilter> filters, required List<String> relays, Duration? autoCloseAfter}) → void
Register a new subscription.
toString() String
A string representation of this object.
inherited
updateSubscription(String subscriptionId, {int? eventCount}) → void
Update subscription metadata (e.g., event count).

Operators

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