loadWithIsolate<T> method
Implementation
Future<T> loadWithIsolate<T>(Future<T> Function() function) async {
if (_currentIsolates < _maxIsolates) {
_currentIsolates++;
return _executeIsolate(function);
} else {
final completer = Completer<T>();
_taskQueue.add(() async {
final result = await _executeIsolate(function);
completer.complete(result);
});
return completer.future;
}
}