Dart Isolates - Flutter compute function - Multithreading in Dart and Flutter

  Рет қаралды 17,738

Flutter Explained

Flutter Explained

Күн бұрын

Пікірлер: 67
@Raimkhodzhanov
@Raimkhodzhanov 2 жыл бұрын
Thank You! Very interesting and helpful video! From Russia with love!
@blueice1364
@blueice1364 3 жыл бұрын
Thanks a billion. This is the best explanation of isolates and compute so far.
@khanisrarahmedalihusain
@khanisrarahmedalihusain 3 жыл бұрын
I haven't used it yet, but I found there are some cases in my Project where I can use it and I will.
@キルア-w8g
@キルア-w8g 4 жыл бұрын
Quick, understandable and helpful. You and people like you are gifts from the god himself for the humanity. Thanks for the great video!
@FlutterExplained
@FlutterExplained 4 жыл бұрын
Thank you for this amazing feedback! I am glad that it helped you :)
@SEGVeenstra
@SEGVeenstra 3 жыл бұрын
One of the more clear explanations, well done! I haven't used them, yet, I'm kind of looking into them because I think I might need them. My use case: I'm creating a Solver for my own puzzle game. It will look for all the possible solutions. For the smaller puzzles, this works in a matter of milliseconds, but when it tries to solve a complex puzzle, it might take seconds, or even minutes. I feel like that's a good use-case because I can run the solver without blocking the app (as it's currently doing).
@FlutterExplained
@FlutterExplained 3 жыл бұрын
Sounds really like a perfect usecase, but in general I am not really happy with that video :) it was a bit to complex and talked into multiple layers, I have it on my list to create an Isolates Version 2 video :)
@metatechnologist
@metatechnologist 2 жыл бұрын
@@FlutterExplained Here's a question, say that the code is running on a four core processor. Is there a way I can assign specific code to run on a specific core only??? I.e. I want to give specific code its own core for various security/performance reasons. I imagine there's probably a way to do this by pulling out the compiler source code lol.
@rutviktak716
@rutviktak716 4 жыл бұрын
Understood how to work with isolates but had to go through it multiple times though worth the time. Thanx for the amazing video💙
@FlutterExplained
@FlutterExplained 4 жыл бұрын
I am really glad that it helped you!
@Mustafa-f7j6t
@Mustafa-f7j6t 3 жыл бұрын
Thank man you are the only one make me understand Isolate❤️
@FlutterExplained
@FlutterExplained 3 жыл бұрын
You are most welcome :)
@dilshan3372
@dilshan3372 4 жыл бұрын
You have done great job for flutter . Thanks for your explanations😇☺️
@FlutterExplained
@FlutterExplained 4 жыл бұрын
Thank you so much, I am so happy that it helped you :)
@andersonfs
@andersonfs 3 жыл бұрын
helpful on an offline-first approach, consuming a queue of offline events that need to be synchronized with the cloud without blocking the UI. Doing that without Isolates led me to frame drops.
@brandonpillay9025
@brandonpillay9025 4 жыл бұрын
Thank you for sharing your knowledge!
@FlutterExplained
@FlutterExplained 4 жыл бұрын
You are most welcome, I hope you can use it :)
@beginnerscircle6410
@beginnerscircle6410 3 жыл бұрын
I have been able to make use use of it in a project I needed to do some background upload.
@shekharmahadik246
@shekharmahadik246 3 жыл бұрын
Hi sir i like way you explain the topic and i new in flutter and thanks to help..... 🙏
@FlutterExplained
@FlutterExplained 3 жыл бұрын
You are most welcome :) thank you for the feedback. ☺️
@dipakbari4
@dipakbari4 4 жыл бұрын
9:10 I have a confusion on line no.22 => inside compute function we've called computeFunction but didn't pass the params in it. Intead we've used (,) then passed params (random...).
@epicmap
@epicmap 2 жыл бұрын
On line 22 we have not called the computeFunction. We passed it (by name, without parentheses) as an argument to the compute function. The compute function will invoke any passed function with provided arguments inside a newly spawned isolated thread for us.
@medamine194
@medamine194 4 жыл бұрын
very great explanation. i think you could use your white board to explain complex topic like this with drawing... its very useful.
@FlutterExplained
@FlutterExplained 4 жыл бұрын
Thank you for your feedback and the idea, I will try to think about it the next time :).
@bilalsimsek7306
@bilalsimsek7306 4 жыл бұрын
thanks for great tutorial
@FlutterExplained
@FlutterExplained 4 жыл бұрын
You are welcome, I hope it helped you!
@MarcS152
@MarcS152 4 жыл бұрын
Can I get a progress from a compute function?
@balkhan619
@balkhan619 2 жыл бұрын
Can two isolates interact with a single db on device, something like sqflite?
@FlutterExplained
@FlutterExplained 2 жыл бұрын
Should be possible, but be mindful with transactions and async because it could created it faster / slower then the other process.
@krishbhanushali8310
@krishbhanushali8310 2 жыл бұрын
no. You cannot use isolates with platform channel apis like sqflite. It will work for objectbox or hive
@Cherupakstmt
@Cherupakstmt 4 жыл бұрын
Great thanks for the topic
@FlutterExplained
@FlutterExplained 4 жыл бұрын
You are very welcome :). I hope it fits your needs!
@sammason547
@sammason547 4 жыл бұрын
Hi, this video was great and really helped me! I am just having issue with trying to kill the isolate to prevent the completion of a task on a button press? Any help is much appreciated it!
@FlutterExplained
@FlutterExplained 4 жыл бұрын
If you use an isolate class you could work with the kill method and intercept the computation. api.flutter.dev/flutter/dart-isolate/Isolate/kill.html
@sammason547
@sammason547 4 жыл бұрын
@@FlutterExplained Thanks for the response, I looked into it a bit more and managed to figure a solution! Thanks!
@FlutterExplained
@FlutterExplained 4 жыл бұрын
Amazing congratulations :)
@LMrc534
@LMrc534 2 жыл бұрын
my stopwatch app is stop running when a press the back button, i ear the isoltate can be the solution. how can i implement it please?
@sangamkumar7409
@sangamkumar7409 3 жыл бұрын
i am making an application wherein we are using webrtc.....could you help me by telling how we can play the video(in pip mode) in while the app is in background.
@thidiyaslimbu464
@thidiyaslimbu464 3 жыл бұрын
My application requires reading a lot of images from memory and displaying then in a list.these images are often huge in size so takes a lot of time loading them. Is isolate best for this scenario?
@epicmap
@epicmap 2 жыл бұрын
I saw some flutter packages uses isolates for this exact purpose - reading images (e.g. from cache). So looks like a nice use case.
@mikemannox4191
@mikemannox4191 4 жыл бұрын
With regards to compute - How can I pass it a reference of a method and its args for isolate processing? Thx
@sanketkoli8641
@sanketkoli8641 3 жыл бұрын
I have an api that takes 8-10 seconds to get response. By the time I want to navigate through app when my function is still running. Which best method can I use? Thanks!
@ahmedgames9335
@ahmedgames9335 3 жыл бұрын
I created a button to run a loop to print any sentence and I quit the application after pressing the button and the application is in the background I did not close it completely and the Loop is still working This means that when a code is in an active state or a specific event, it is still happening in the background Am I right or No
@j3rry837
@j3rry837 3 жыл бұрын
I had to read 500+ page PDF. Its super slow process so i think isolate is the solution
@epicmap
@epicmap 2 жыл бұрын
10:52 with this question I came here, but didn't got any answer, even one was promised at 0:13
@pranishramteke7642
@pranishramteke7642 4 жыл бұрын
I think this won't be relevant for me as I just know how to make UIs in flutter. But I'm confused which libraries are useful to me and how do I find libraries relevant to myself. I don't have a project as such but wanna know more about flutter. Any suggestions about how to go ahead?
@FlutterExplained
@FlutterExplained 4 жыл бұрын
I think to evaluate if a particular package is useful for you, you will have to test it out. If you want to know in general more about Flutter I can recommend you the Flutter roadmap in this article: medium.com/flutterdevs/roadmap-to-become-a-flutter-developer-resources-for-beginners-ccb68718c84b
@pranishramteke7642
@pranishramteke7642 4 жыл бұрын
@@FlutterExplained Thanks a lot. This seems helpful, I'll check and follow this. Hopefully I'll catch up. Thanks man.
@FlutterExplained
@FlutterExplained 4 жыл бұрын
You are very welcome, if you have more questions feel free to ask on twitter anytime :)
@pranishramteke7642
@pranishramteke7642 4 жыл бұрын
@@FlutterExplained sure. I will. Now, a flutter expert has my back :')
@pradeep422
@pradeep422 4 жыл бұрын
k, I used to hav reasonalble knowledge f ports u just confused me on this 1 lol....(some kinda diagram might helped with ports, dart team themselves did poor job naming ports very confusing for me)
@FlutterExplained
@FlutterExplained 4 жыл бұрын
Uh sorry to hear that, maybe I can help to reduce the confusion? Which part was not clear?
@pradeep422
@pradeep422 4 жыл бұрын
will try to watch more slowly!!!
@pradeep422
@pradeep422 4 жыл бұрын
should hav used tht white board in background lol
@pradeep422
@pradeep422 4 жыл бұрын
sry for dislike
@FlutterExplained
@FlutterExplained 4 жыл бұрын
@@pradeep422 Yeah, here on that video I have also a graph that could maybe help you. kzbin.info/www/bejne/d4C1q2pjZbSMb80
@eightrice
@eightrice 3 жыл бұрын
so is this really the simplest way to describe how multithreading works in dart? Cause it's quite complicated for my particular brain.. calling APIs and whatnot.. can't you just make an example where you do some adding or something? All examples of isolates on youtube are complicated... or maybe I'm just too dumb
@nidalbakir4720
@nidalbakir4720 3 жыл бұрын
there are too many working around if you are a "software eng" you should really observe that!. and why are you using ports like that? just use one receive port and one send port in each of the isolate!
@FlutterExplained
@FlutterExplained 3 жыл бұрын
Hi there, thanks for your feedback and sorry that you did not like the video. I will try to improve in the future.
@nidalbakir4720
@nidalbakir4720 3 жыл бұрын
@@FlutterExplained Looking forward for new videos. All the best 😊
@FlutterExplained
@FlutterExplained 3 жыл бұрын
@@nidalbakir4720 Thank you :)
@eightrice
@eightrice 3 жыл бұрын
@@FlutterExplained this seems like a generic bot answer... lifeless..
@funnyfailsvids-o2
@funnyfailsvids-o2 2 жыл бұрын
Why didn't Flutter make it simple as coroutines 😏😭
@PanneerNovac
@PanneerNovac Жыл бұрын
Hi, below error showing, share sample code API Calling The BackgroundIsolateBinaryMessenger.instance value is invalid until BackgroundIsolateBinaryMessenger.ensureInitialized is executed.
🎈🎈🎈😲 #tiktok #shorts
0:28
Byungari 병아리언니
Рет қаралды 4,5 МЛН
-5+3은 뭔가요? 📚 #shorts
0:19
5 분 Tricks
Рет қаралды 13 МЛН
Wednesday VS Enid: Who is The Best Mommy? #shorts
0:14
Troom Oki Toki
Рет қаралды 50 МЛН
When, why, and how to multithread in Flutter
15:10
Flutter
Рет қаралды 67 М.
Learn to use Isolates in Flutter | Simplified
10:28
CodeX
Рет қаралды 34 М.
7 Outside The Box Puzzles
12:16
MindYourDecisions
Рет қаралды 9 М.
Featherweight Isolates in Flutter
15:22
Flutter Melbourne
Рет қаралды 7 М.
Automate your Testing on Devices with Flutter Integration Testing
20:33
Flutter Explained
Рет қаралды 50 М.
Isolates and Event Loops - Flutter in Focus
5:48
Flutter
Рет қаралды 228 М.
Async vs Isolates | Decoding Flutter
4:24
Flutter
Рет қаралды 130 М.
🎈🎈🎈😲 #tiktok #shorts
0:28
Byungari 병아리언니
Рет қаралды 4,5 МЛН