I'm thinking about the new Isolate.run mechanism in Dart 2.19. For those that don't know it allows one to spawn a processing thread and return the result in one line. Thus having background work come back to you is as simple as an async/await but it won't block the main thread. Is there a major downside to liberally using this? Noodling on it for some post-network processing stuff I do in the main thread with asynchronous programming but that produces periodic jank... #flutter #DartLang https://api.flutter.dev/flutter/dart-isolate/Isolate/run.html
inicornie
in reply to Hank G ☑️ • • •like this
Sean Riley and Hank G ☑️ like this.
Hank G ☑️
in reply to inicornie • •inicornie
in reply to Hank G ☑️ • • •Looking it up, seems like they are actually
isolate_pool_2 | Dart Package
Dart packagesHank G ☑️ likes this.
arshak
in reply to Hank G ☑️ • • •https://maksimka101.github.io/docusaurus-blog/blog/combine/
https://github.com/Maksimka101/combine/
GitHub - Maksimka101/combine: A Flutter package which allows you to work with MethodChannels in Isolate and provides simplified Isolate and Thread Pool API
GitHubHank G ☑️ likes this.
Hank G ☑️
in reply to arshak • •arshak
in reply to Hank G ☑️ • • •It also makes it easy to use MethodChannels inside isolates
Hank G ☑️ likes this.
Hank G ☑️
in reply to arshak • •arshak
in reply to Hank G ☑️ • • •Yeah, Combine is good when you want to keep the isolate for some kind of tasks. For example, you could parse JSONs from API responses only when they are big enough (because otherwise it takes longer and doesn’t really affect the rendering)
Hank G ☑️ likes this.