MCPcopy Index your code
hub / github.com/blacklanternsecurity/bbot / run_task

Method run_task

bbot/modules/base.py:942–950  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 """

Callers 3

_handle_batchMethod · 0.95
_workerMethod · 0.95
_workerMethod · 0.80

Calls 2

countMethod · 0.80
_acatchMethod · 0.45

Tested by

no test coverage detected