run<R> method
Runs computation in a worker isolate and returns its result.
Same rules as Isolate.run for computation (it must be sendable)
and its result.
Implementation
Future<R> run<R>(FutureOr<R> Function() computation) {
if (_closed) {
return Future.error(StateError("Closed `APIIsolatePool`: $debugName"));
}
final job = _PoolJob<R>(computation);
_queue.add(job);
_dispatch();
return job.completer.future;
}