killIsolate method

Future<void> killIsolate()

Kills the persistent async isolate while keeping the session alive. The session can still be used for new inference runs after calling this. Next runAsync() will create a new isolate. Note: This only kills the persistent isolate, not one-time isolates.

Implementation

Future<void> killIsolate() async {
  if (_persistentIsolateSession != null) {
    await _persistentIsolateSession!.release();
    _persistentIsolateSession = null;
  }
}