startChunkedConversion method

  1. @override
Sink<String> startChunkedConversion(
  1. Sink<List<List<String>>> sink
)
override

Starts a chunked conversion.

The returned sink serves as input for the long-running conversion. The given sink serves as output.

Implementation

@override
Sink<String> startChunkedConversion(Sink<List<List<String>>> sink) {
  final input = parseAsync(_parser.parseStart$Async, (result) {
    try {
      final value = result.getResult();
      sink.add(value);
    } catch (error, stackTrace) {
      if (sink case final EventSink<Object?> sink) {
        sink.addError(error, stackTrace);
      } else {
        rethrow;
      }
    }
  });
  return input;
}