runForMultipleInputs method

Future<void> runForMultipleInputs(
  1. List<Object> inputs,
  2. Map<int, Object> outputs
)

Run LiteRT model for multiple inputs and outputs.

Calls are serialized: a call issued while a previous run is still in flight waits its turn. (Earlier versions silently dropped such calls, returning normally without writing outputs.) To skip frames instead of queueing, check state before calling.

Throws StateError if close has been called.

Implementation

Future<void> runForMultipleInputs(
  List<Object> inputs,
  Map<int, Object> outputs,
) {
  if (_closed) {
    throw StateError('IsolateInterpreter.run called after close().');
  }
  final run = _runQueue.then((_) => _runSerialized(inputs, outputs));
  _runQueue = run.then((_) {}, onError: (_) {});
  return run;
}