pitrou commented on code in PR #37970:
URL: https://github.com/apache/arrow/pull/37970#discussion_r1344254047


##########
cpp/src/arrow/ipc/reader.h:
##########
@@ -425,6 +425,37 @@ class ARROW_EXPORT StreamDecoder {
   /// \return Status
   Status Consume(std::shared_ptr<Buffer> buffer);
 
+  /// \brief Reset the internal status.
+  ///
+  /// You can reuse this decoder for new stream after calling
+  /// this. For example, you can implement endless decoder with this:

Review Comment:
   Honestly, I don't think the endless decoder is very useful (why would I want 
an endless decoder?). Perhaps we can simply remove it?



##########
cpp/src/arrow/ipc/reader.cc:
##########
@@ -2032,6 +2036,11 @@ Status StreamDecoder::Consume(const uint8_t* data, 
int64_t size) {
 Status StreamDecoder::Consume(std::shared_ptr<Buffer> buffer) {
   return impl_->Consume(std::move(buffer));
 }
+Status StreamDecoder::Reset() {
+  impl_ =
+      std::make_unique<StreamDecoderImpl>(std::move(impl_->listener()), 
impl_->options());

Review Comment:
   Nit: `std::move` on a rvalue is probably a no-op.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to