diff options
Diffstat (limited to 'aergia')
| -rwxr-xr-x | aergia | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -246,11 +246,17 @@ class Aergia(object): '''Given an asyncio event loop, returns the list of idle task frames. A task is considered 'idle' if it is not currently executing.''' curr_task = asyncio.current_task(loop) - return [ - task.get_coro().cr_frame - for task in asyncio.all_tasks(loop) - if task is not curr_task - ] + if curr_task: + curr_task.print_stack() + idle = [] + for task in asyncio.all_tasks(loop): + if task is not curr_task: + # according to docs, the frames are always ordered from oldest + # to newest + # task.print_stack() + # https://stackoverflow.com/questions/73657828/how-to-tell-where-an-asyncio-task-is-waiting + idle.append(task.get_stack()[0]) + return idle @staticmethod def sum_sample(sample): |
