Asynchronously queues an incoming event to the module's event queue for further processing. The function performs an initial check to see if the event is acceptable for queuing. If the event passes the check, it is put into the `incoming_event_queue`. Args:
(self, event)
| 970 | await asyncio.sleep(self._event_handler_watchdog_interval) |
| 971 | |
| 972 | async def queue_event(self, event): |
| 973 | """ |
| 974 | Asynchronously queues an incoming event to the module's event queue for further processing. |
| 975 | |
| 976 | The function performs an initial check to see if the event is acceptable for queuing. |
| 977 | If the event passes the check, it is put into the `incoming_event_queue`. |
| 978 | |
| 979 | Args: |
| 980 | event: The event object to be queued. |
| 981 | |
| 982 | Returns: |
| 983 | None: The function doesn't return anything but modifies the state of the `incoming_event_queue`. |
| 984 | |
| 985 | Examples: |
| 986 | >>> await self.queue_event(some_event) |
| 987 | |
| 988 | Raises: |
| 989 | AttributeError: If the module is not in an acceptable state to queue incoming events. |
| 990 | """ |
| 991 | async with self._task_counter.count("queue_event()", _log=False): |
| 992 | if self.incoming_event_queue is False: |
| 993 | self.debug("Not in an acceptable state to queue incoming event") |
| 994 | return |
| 995 | acceptable, reason = self._event_precheck(event) |
| 996 | if not acceptable: |
| 997 | if reason and reason != "its type is not in watched_events": |
| 998 | self.debug(f"Not queueing {event} because {reason}") |
| 999 | return |
| 1000 | else: |
| 1001 | self.debug(f"Queueing {event} because {reason}") |
| 1002 | try: |
| 1003 | self.incoming_event_queue.put_nowait(event) |
| 1004 | async with self.event_received: |
| 1005 | self.event_received.notify() |
| 1006 | if event.type != "FINISHED": |
| 1007 | self.scan._new_activity = True |
| 1008 | except AttributeError: |
| 1009 | self.debug("Not in an acceptable state to queue incoming event") |
| 1010 | |
| 1011 | async def queue_outgoing_event(self, event, **kwargs): |
| 1012 | """ |