-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(engine): Improve missing secrets visibility in AuthSandbox (#217)
- Loading branch information
1 parent
e2ba8b1
commit f2d9acf
Showing
3 changed files
with
71 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import asyncio | ||
|
||
|
||
class GatheringTaskGroup[T](asyncio.TaskGroup): | ||
"""Convenience class to gather results from tasks in a task group.""" | ||
|
||
def __init__(self): | ||
super().__init__() | ||
self.__tasks: list[asyncio.Task[T]] = [] | ||
|
||
def create_task(self, coro, *, name=None, context=None) -> asyncio.Task[T]: | ||
task = super().create_task(coro, name=name, context=context) | ||
self.__tasks.append(task) | ||
return task | ||
|
||
def results(self) -> list[T]: | ||
return [task.result() for task in self.__tasks] |