Since it is early stages of development, the chang...
# flyte-support
a
Since it is early stages of development, the change might be easier
f
That’s a great feedback
But how do you recommend we do it
We used Asyncio because it is native to python
Anyio is a layer on top, any reason you think we should prefer anyio in the framework
Does it cause problems in context or interoperable
a
Shamelessly coping from Chat-GPT
Copy code
```Key Advantages of anyio
	1.	Structured concurrency:
	•	Prevents task leaks.
	•	Tasks are cancelled when their parent scope exits.
	•	Helps write safe, maintainable async code.
	2.	Interoperability:
	•	Works with both asyncio and trio.
	•	Lets you write backend-agnostic async code.
	3.	Unified API:
	•	Same API regardless of whether you're using asyncio or trio.
	4.	Better cancellation handling:
	•	Uses cancel scopes like trio, making cleanup easier and more predictable.
I have just started looking at the code, so might be right now asyncio does the work well. But i have been using anyio recently for my operation and i think it give all functionality of asyncio + added benefits as above. Moreover it can plug asyncio and trio, so the user is not bound by the backend. But with asyncio, they are tied
b
There are a few gotchas with asyncio, that trio and anyio resolves: https://sailor.li/asyncio
👍 1
f
Great points - few things are changing soon @acceptable-knife-37130 The core is actually moving to rust - for reasons of concurrency management But as I read it the challenge is for end users to write correct code providing them an option to use trio would be beneficial