Start a task while tracking it in the module's task counter. This lets us keep a detailed module status and selectively cancel tasks when needed, like when handle_event exceeds its max runtime.
(self, coro, name, n=1)
| 940 | await self.helpers.execute_sync_or_async(callback) |
| 941 | |
| 942 | async def run_task(self, coro, name, n=1): |
| 943 | """ |
| 944 | Start a task while tracking it in the module's task counter. |
| 945 | |
| 946 | This lets us keep a detailed module status and selectively cancel tasks when needed, like when handle_event exceeds its max runtime. |
| 947 | """ |
| 948 | task = asyncio.create_task(coro) |
| 949 | async with self.scan._acatch(context=name), self._task_counter.count(task_name=name, asyncio_task=task, n=n): |
| 950 | return await task |
| 951 | |
| 952 | async def _event_handler_watchdog(self): |
| 953 | """ |
no test coverage detected