close method

  1. @override
Future<void> close()
override

Stops the generation in flight and every turn queued behind it, waits for its JS stream to end, and deletes the JS conversation. A stream that does not end within drainTimeout poisons the page lock (LiteRtLmPageLock.poisonFor): the module may still be suspended in it, so nothing else may enter, and the returned future fails with that error. The conversation is then left to the page.

Implementation

@override
Future<void> close() => _closedFuture ??= _close();