Skip to content

Commit a6885d6

Browse files
committed
Handle nested asyncio loops
1 parent 201d4b9 commit a6885d6

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ build = [
4141
# guarded with optional_import() calls.
4242
"virtualenv>=20.4",
4343
"PyYAML>=6.0",
44+
"nest-asyncio>=1.6.0"
4445
]
4546
test = [
4647
"isolate[build]",

src/isolate/connections/grpc/agent.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,4 +252,9 @@ async def main() -> int:
252252

253253

254254
if __name__ == "__main__":
255+
# fal-sdk uses it's own asyncio loop, which assumes it's only one.
256+
# Patch asyncio to allow nested loops, since we can't change existing apps
257+
import nest_asyncio
258+
259+
nest_asyncio.apply()
255260
asyncio.run(main())

0 commit comments

Comments
 (0)