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 = null;

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

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

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