def _pop_triggered_events(self, result: ua.PublishResult):
     """Append all enqueued events to the given `PublishResult` and clear the queue."""
     if self._triggered_events:
         notif = ua.EventNotificationList()
         notif.Events = [item for sublist in self._triggered_events.values() for item in sublist]
         self._triggered_events = {}
         result.NotificationMessage.NotificationData.append(notif)
Ejemplo n.º 2
0
 def _pop_triggered_events(self, result):
     if self._triggered_events:
         notif = ua.EventNotificationList()
         notif.Events = [
             item for sublist in self._triggered_events.values()
             for item in sublist
         ]
         self._triggered_events = {}
         result.NotificationMessage.NotificationData.append(notif)
         self.logger.debug("sending event notification with %s events",
                           len(notif.Events))