async def ReportEvents(self, request, context): received_events = [] if request.event_strings: received_events.extend(parse_event_strings(request.event_strings)) logger.info("Received %d events", len(received_events)) self._update_events(received_events) return event_pb2.ReportEventsReply(send_success=True)
async def run(self, server): event_pb2_grpc.add_ReportEventServiceServicer_to_server(self, server) self._monitor = monitor_events( self._event_dir, lambda data: self._update_events(parse_event_strings(data)), source_types=event_consts.EVENT_HEAD_MONITOR_SOURCE_TYPES, )