In flutter when using the http package or doing general IO operations for example
import 'package:http/http.dart' as http;
http.Response response = await http.get(url);
if (response.statusCode == 200) {
var json = jsonDecode(response.body);
}
I have read through The engine architecture which indicates there are 4 threads in the engine
- Platform Task Runner
- UI Task Runner
- GPU Task Runner
- IO Task Runner
The main app dart code runs on the UI Task Runner Thread. The IO task runner seems to be only for the dart engine to read images handle time consuming image IO and not where application IO happens?
I understand that the IO libraries have no-blocking Future based interfaces so the callbacks I provide to the IO libraries will run on the UI thread but what about the actual IO operations themselves is there an OS thread that the Dart VM is using to do these operations?
For example if I try to upload/download an 800MB video file is there a background IO thread that the Dart VM uses do the actual IO?
Should a separate isolate be used for large IO operations like uploading / downloading large files?