-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[C++] Make public version of StreamDecoderImpl-like class #37429
Comments
How about adding |
It's just one approach. In addition to
In that way I'm must determine where message with schema is located (to feed resetted Another approach is to make |
How about calling class EndlessListener : public arrow::ipc::Listener {
public:
explicit EndlessListener() : arrow::ipc::Listener(), decoders_() {}
arrow::Status OnEOS() override {
for (auto decoder : decoders_) {
ARROW_RETURN_NOT_OK(decoder->Reset());
}
return arrow::Status::OK();
}
void AddDecoder(arrow::ipc::StreamDecoder *decoder) {
decoders_.push_back(decoder);
}
private:
std::vector<arrow::ipc::StreamDecoder> decoders_;
};
auto listener = std::make_shared<EndlessListener>();
arrow::ipc::StreamDecoder decoder (listener);
listener->AddDecoder(*decoder);
decoder.Consume(...); |
That's awesome! |
We can reuse the same StreamDecoder to read multiple streams with this.
We can reuse the same StreamDecoder to read multiple streams with this.
(moved to #37970 (comment)) |
We can reuse the same StreamDecoder to read multiple streams with this.
### Rationale for this change We can reuse the same StreamDecoder to read multiple streams with this. ### What changes are included in this PR? Add StreamDecoder::Reset(). ### Are these changes tested? Yes. ### Are there any user-facing changes? Yes. * Closes: #37429 Authored-by: Sutou Kouhei <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
…37970) ### Rationale for this change We can reuse the same StreamDecoder to read multiple streams with this. ### What changes are included in this PR? Add StreamDecoder::Reset(). ### Are these changes tested? Yes. ### Are there any user-facing changes? Yes. * Closes: apache#37429 Authored-by: Sutou Kouhei <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
…37970) ### Rationale for this change We can reuse the same StreamDecoder to read multiple streams with this. ### What changes are included in this PR? Add StreamDecoder::Reset(). ### Are these changes tested? Yes. ### Are there any user-facing changes? Yes. * Closes: apache#37429 Authored-by: Sutou Kouhei <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
Describe the enhancement requested
It is useful to use
StreamDecoderImpl
outsidereader.cc
.For example, someone produces stream of data like that:
StreamDecoder in that way will ignore all payload after (*). But in way where StreamDecoderImpl-like class is open to use, I can use OnMessageDecoded(..) method and delegate message decoding in outer scope and when EOS coming, reseting StreamDecoderImpl to new.
Component(s)
C++
The text was updated successfully, but these errors were encountered: