MCPcopy Create free account
hub / github.com/FreeOpcUa/python-opcua / _call_event

Method _call_event

opcua/common/subscription.py:165–182  ·  view source on GitHub ↗
(self, eventlist)

Source from the content-addressed store, hash-verified

163 self.logger.error("DataChange subscription created but handler has no datachange_notification method")
164
165 def _call_event(self, eventlist):
166 for event in eventlist.Events:
167 with self._lock:
168 data = self._monitoreditems_map[event.ClientHandle]
169 result = events.Event.from_event_fields(data.mfilter.SelectClauses, event.EventFields)
170 result.server_handle = data.server_handle
171 if hasattr(self._handler, "event_notification"):
172 try:
173 self._handler.event_notification(result)
174 except Exception:
175 self.logger.exception("Exception calling event handler")
176 elif hasattr(self._handler, "event"): # depcrecated API
177 try:
178 self._handler.event(data.server_handle, result)
179 except Exception:
180 self.logger.exception("Exception calling deprecated event handler")
181 else:
182 self.logger.error("Event subscription created but handler has no event_notification method")
183
184 def _call_status(self, status):
185 try:

Callers 1

publish_callbackMethod · 0.95

Calls 2

from_event_fieldsMethod · 0.80
event_notificationMethod · 0.45

Tested by

no test coverage detected