streamFromInputStream method

  1. @override
Stream<Map<String, dynamic>> streamFromInputStream(
  1. Stream<ParserInput> inputStream, {
  2. OutputParserOptions? options,
})
override

Streams the output of invoking the Runnable on the given inputStream.

  • inputStream - the input stream to invoke the Runnable on.
  • options - the options to use when invoking the Runnable.

Implementation

@override
Stream<Map<String, dynamic>> streamFromInputStream(
  final Stream<ParserInput> inputStream, {
  final OutputParserOptions? options,
}) async* {
  if (reduceOutputStream) {
    await inputStream.forEach(
      (final input) => _parseStream(input, options: options),
    );
    yield _lastOutputMap;
    _clear();
  } else {
    yield* super
        .streamFromInputStream(inputStream, options: options)
        .distinct(const DeepCollectionEquality().equals)
        .doOnCancel(_clear);
  }
}