Flutter : Future and EventLoop

Dr_Skele·2023년 3월 6일
0

Flutter

목록 보기
11/19

In flutter app, the future is used all over the place. It makes asynchronous task much easier to implement with async and await. But the thing is as the number of future gets larger and larger, it gets harder to know when these futures will end.

Ofcourse we have await and then to handle the orders, but if those futures are not associated with each other, it's hard to use them.

What I've found out is that in dart event loop, there's two queues and one has priority over the other. The microtask queue is executed and then the common event queue is executed.

Microtask can be made with Future.microtask().

I didn't have much complex situations where these microtasks were needed, but I found these interesting. Maybe I'll find this useful in the 'future'.

reference : https://medium.flutterdevs.com/event-loop-in-dart-226a7487b4aa

profile
Tireless And Restless Debugging In Source : TARDIS

0개의 댓글