IssueNotificationEvents method

Future<void> IssueNotificationEvents(
  1. GetStreamingEventsResponse gseResponse
)
Issues the notification events. The GetStreamingEvents response.

Implementation

/* private */
Future<void> IssueNotificationEvents(
  GetStreamingEventsResponse gseResponse,
) async {
  for (NotificationGroup events in gseResponse.Results.Notifications) {
    StreamingSubscription? subscription;

    await _lockObject.synchronized(() async {
      // Client can do any good or bad things in the below event handler
      if (_subscriptions.containsKey(events.SubscriptionId)) {
        subscription = _subscriptions[events.SubscriptionId];
      }
    });

    if (subscription != null) {
      NotificationEventArgs eventArgs = NotificationEventArgs(
        subscription!,
        events.Events,
      );

      for (final delegate in OnNotificationEvent) {
        delegate(this, eventArgs);
      }
    }
  }
}