| 514 | } |
| 515 | |
| 516 | Future<std::shared_ptr<StreamingReader>> StreamingReader::MakeAsync( |
| 517 | std::shared_ptr<io::InputStream> stream, const ReadOptions& read_options, |
| 518 | const ParseOptions& parse_options, const io::IOContext& io_context, |
| 519 | Executor* cpu_executor) { |
| 520 | auto future = StreamingReaderImpl::MakeAsync( |
| 521 | std::make_shared<DecodeContext>(parse_options, io_context.pool()), |
| 522 | std::move(stream), io_context, cpu_executor, read_options); |
| 523 | return future.Then([](const std::shared_ptr<StreamingReaderImpl>& reader) { |
| 524 | return std::static_pointer_cast<StreamingReader>(reader); |
| 525 | }); |
| 526 | } |
| 527 | |
| 528 | Result<std::shared_ptr<StreamingReader>> StreamingReader::Make( |
| 529 | std::shared_ptr<io::InputStream> stream, const ReadOptions& read_options, |